a few words about web development

PH7- lighweight PHP interpreter

Interesting alternative to official PHP interpreter
PH7 is a bytecode compiler and a virtual machine for PHP programming language created by Symsisc. It does not support all the features and functions of PHP language but it's fast and lightweight so can be used even on embedded systems. For defailed information you can visit project's github.

Some of the features:
  • Function & Method Overloading
  • Powerful OO subsystem.
  • 64-bit integer arithmetic for all platforms.
  • Native UTF-8 support.
  • Written in ANSI C, thread-safe
  • You can compile and run unmodified in any platform including restricted embedded devices with a C compiler
  • Built with more 470 function including an XML parser (with namespace support), INI processor, CSV reader/writer, UTF-8 encoder/decoder, zip archive extractor, JSON encoder/decoder, random number/strings generator, native and efficient File IO for Windows and UNIX systems and many more
  • Open-Source



Compiling PH7 interpreter with GCC


gcc -W -Wall -O6 -D PH7_ENABLE_MATH_FUNC -o ph7 ph7_interp.c ph7.c

Running PHP scripts with PH7 interpreter


Usage is very similar to standard PHP interpreter:
ph7 hello_world.php

Built-in PHP functions


Not all PHP functions are implemented in PH7. Here's the full list (without classes and their methods):
  • abs
  • acos
  • addcslashes
  • addslashes
  • array_chunk
  • array_combine
  • array_copy
  • array_diff
  • array_diff_assoc
  • array_diff_key
  • array_diff_uassoc
  • array_erase
  • array_fill
  • array_fill_keys
  • array_filter
  • array_flip
  • array_intersect
  • array_intersect_assoc
  • array_intersect_key
  • array_key_exists
  • array_keys
  • array_map
  • array_merge
  • array_pad
  • array_pop
  • array_product
  • array_push
  • array_rand
  • array_reduce
  • array_replace
  • array_reverse
  • array_same
  • array_search
  • array_shift
  • array_slice
  • array_splice
  • array_sum
  • array_udiff
  • array_uintersect
  • array_unique
  • array_values
  • array_walk
  • array_walk_recursive
  • arsort
  • asin
  • asort
  • assert
  • assert_options
  • atan
  • atan2
  • base64_decode
  • base64_encode
  • base_convert
  • basename
  • bin2hex
  • bindec
  • dir
  • call_user_func
  • call_user_func_array
  • ceil
  • chdir
  • chgrp
  • chmod
  • chop
  • chown
  • chr
  • chroot
  • chunk_split
  • class_alias
  • class_exists
  • closedir
  • compact
  • constant
  • convert_uudecode
  • convert_uuencode
  • copy
  • cos
  • cosh
  • count
  • crc32
  • ctype_alnum
  • ctype_alpha
  • ctype_cntrl
  • ctype_digit
  • ctype_graph
  • ctype_lower
  • ctype_print
  • ctype_punct
  • ctype_space
  • ctype_upper
  • ctype_xdigit
  • current
  • date
  • debug_backtrace
  • debug_print_backtrace
  • debug_string_backtrace
  • decbin
  • dechex
  • decoct
  • define
  • defined
  • delete
  • die
  • dirname
  • disk_free_space
  • disk_total_space
  • diskfreespace
  • douleval
  • each
  • echo
  • empty
  • end
  • error_get_last
  • error_log
  • error_reporting
  • eval
  • exit
  • exp
  • explode
  • extract
  • fclose
  • feof
  • fflush
  • fgetc
  • fgetcsv
  • fgets
  • fgetss
  • file
  • file_exists
  • file_get_contents
  • file_put_contents
  • fileatime
  • filectime
  • filemtime
  • filesize
  • filetype
  • floatval
  • flock
  • floor
  • flush
  • fmod
  • fnmatch
  • fopen
  • forward_static_call
  • forward_static_call_array
  • fpassthru
  • fprintf
  • fputcsv
  • fputs
  • fread
  • fseek
  • fstat
  • ftell
  • ftruncate
  • func_get_arg
  • func_get_args
  • func_get_args_byref
  • func_num_args
  • function_exists
  • fwrite
  • get_called_class
  • get_class
  • get_class_methods
  • get_class_vars
  • get_current_user
  • get_declared_classes
  • get_declared_interfaces
  • get_defined_classes
  • get_defined_constants
  • get_defined_functions
  • get_defined_vars
  • get_html_translation_table
  • get_include_path
  • get_included_files
  • get_object_vars
  • get_parent_class
  • get_resource_type
  • getcwd
  • getdate
  • getenv
  • getgid
  • getmygid
  • getmypid
  • getmyuid
  • getopt
  • getpid
  • getrandmax
  • gettimeofday
  • gettype
  • getuid
  • gmdate
  • gmmktime
  • hexdec
  • html_entity_decode
  • htmlentities
  • htmlspecialchars
  • htmlspecialchars_decode
  • hypot
  • idate
  • implode
  • implode_recursive
  • import_request_variables
  • in_array
  • include
  • include_once
  • interface_exists
  • intval
  • is_a
  • is_array
  • is_bool
  • is_callable
  • is_dir
  • is_double
  • is_executable
  • is_file
  • is_float
  • is_int
  • is_integer
  • is_link
  • is_long
  • is_null
  • is_numeric
  • is_object
  • is_readable
  • is_real
  • is_resource
  • is_scalar
  • is_string
  • is_subclass_of
  • is_writable
  • isset
  • join
  • join_recursive
  • json_decode
  • json_encode
  • json_last_error
  • key
  • krsort
  • ksort
  • lcfirst
  • link
  • localtime
  • log
  • log10
  • lstat
  • ltrim
  • mb_strtolower
  • mb_strtoupper
  • md5
  • md5_file
  • method_exists
  • microtime
  • mkdir
  • mktime
  • mt_getrandmax
  • mt_rand
  • mt_srand
  • next
  • nl2br
  • ob_clean
  • ob_end_clean
  • ob_end_flush
  • ob_flush
  • ob_get_clean
  • ob_get_contents
  • ob_get_flush
  • ob_get_length
  • ob_get_level
  • ob_implicit_flush
  • ob_list_handlers
  • ob_start
  • octdec
  • opendir
  • ord
  • parse_ini_file
  • parse_ini_string
  • parse_url
  • pathinfo
  • ph7_uname
  • ph7copyright
  • ph7credits
  • ph7info
  • ph7version
  • php_uname
  • pi
  • pos
  • pow
  • prev
  • print
  • print_r
  • printf
  • property_exists
  • putenv
  • quotemeta
  • rand
  • rand_str
  • range
  • rawurldecode
  • rawurlencode
  • readdir
  • readfile
  • realpath
  • register_shutdown_function
  • rename
  • require
  • require_once
  • reset
  • restore_error_handler
  • restore_exception_handler
  • rewind
  • rewinddir
  • rmdir
  • round
  • rsort
  • rtrim
  • serialize
  • set_error_handler
  • set_exception_handler
  • setenv
  • sha1
  • sha1_file
  • shuffle
  • sin
  • sinh
  • size_format
  • sizeof
  • sleep
  • sort
  • soundex
  • sprintf
  • sqrt
  • srand
  • stat
  • str_getcsv
  • str_ireplace
  • str_pad
  • str_repeat
  • str_replace
  • str_shuffle
  • str_split
  • strcasecmp
  • strchr
  • strcmp
  • strcoll
  • strcspn
  • strftime
  • strglob
  • strip_tags
  • stripos
  • stripslashes
  • stristr
  • strlen
  • strncasecmp
  • strncmp
  • strpbrk
  • strpos
  • strrchr
  • strrev
  • strripos
  • strrpos
  • strspn
  • strstr
  • strtok
  • strtolower
  • strtoupper
  • strtr
  • strval
  • substr
  • substr_compare
  • substr_count
  • symlink
  • sys_get_temp_dir
  • tan
  • tanh
  • time
  • touch
  • trigger_error
  • trim
  • uasort
  • ucfirst
  • ucwords
  • uksort
  • umask
  • uniqid
  • unlink
  • unserialize
  • unset
  • urldecode
  • urlencode
  • user_error
  • usleep
  • usort
  • utf8_decode
  • utf8_encode
  • var_dump
  • var_export
  • vfprintf
  • vprintf
  • vsprintf
  • wordwrap
  • xml_error_string
  • xml_get_current_byte_index
  • xml_get_current_column_number
  • xml_get_current_line_number
  • xml_get_error_code
  • xml_parse
  • xml_parser_create
  • xml_parser_create_ns
  • xml_parser_free
  • xml_parser_get_option
  • xml_parser_set_option
  • xml_set_character_data_handler
  • xml_set_default_handler
  • xml_set_element_handler
  • xml_set_end_namespace_decl_handler
  • xml_set_external_entity_ref_handler
  • xml_set_notation_decl_handler
  • xml_set_object
  • xml_set_processing_instruction_handler
  • xml_set_start_namespace_decl_handler
  • xml_set_unparsed_entity_decl_handler
  • zip_close
  • zip_entry_close
  • zip_entry_compressedsize
  • zip_entry_compressionmethod
  • zip_entry_filesize
  • zip_entry_name
  • zip_entry_open
  • zip_entry_read
  • zip_entry_reset_read_cursor
  • zip_open
  • zip_read
  • fileinode
  • filegroup
  • fileowner
  • min
  • max
  • array_merge_recursive
  • array_unshift
  • tempnam
  • tmpfile
  • glob
  • scandir
  • dir

Comments