3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $func = create_function('',' static $foo = 0; return $foo++; '); var_dump($func()); var_dump($func()); var_dump($func());
Output for 4.3.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(0) int(1) int(2)
Output for 4.3.2
NULL NULL NULL *** Error in `php': free(): invalid next size (fast): 0x00000000026c5ed0 ***
Process exited with code 139.
Output for 4.3.1
NULL NULL NULL *** Error in `php': free(): invalid next size (fast): 0x00000000021d0780 ***
Process exited with code 139.
Output for 4.3.0
NULL NULL NULL *** Error in `/bin/php-4.3.0': free(): invalid next size (fast): 0x00000000012c8530 *** ======= Backtrace: ========= /usr/lib/libc.so.6(+0x72055)[0x7fa6715e8055] /usr/lib/libc.so.6(+0x779a6)[0x7fa6715ed9a6] /usr/lib/libc.so.6(+0x7818e)[0x7fa6715ee18e] /bin/php-4.3.0(shutdown_memory_manager+0x5f)[0x50abaf] /bin/php-4.3.0(php_request_shutdown+0x1ee)[0x4f0f6e] /bin/php-4.3.0(main+0xabd)[0x42549d] /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7fa671596610] /bin/php-4.3.0[0x4258dd] ======= Memory map: ======== 00400000-005c7000 r-xp 00000000 00:00 0 005c7000-007c6000 ---p 00000000 00:00 0 007c6000-007e6000 rwxp 00000000 00:00 0 00800000-00801000 rwxp 00000000 00:00 0 01261000-012e5000 rwxp 00000000 00:00 0 [heap] 7fa66c000000-7fa66c021000 rwxp 00000000 00:00 0 7fa66c021000-7fa670000000 ---p 00000000 00:00 0 7fa671140000-7fa671156000 r-xp 00000000 00:12 45938 /usr/lib/libgcc_s.so.1 7fa671156000-7fa671355000 ---p 00016000 00:12 45938 /usr/lib/libgcc_s.so.1 7fa671355000-7fa671356000 rwxp 00015000 00:12 45938 /usr/lib/libgcc_s.so.1 7fa671361000-7fa67136c000 r-xp 00000000 00:12 53308 /usr/lib/libnss_files-2.22.so 7fa67136c000-7fa67156b000 ---p 0000b000 00:12 53308 /usr/lib/libnss_files-2.22.so 7fa67156b000-7fa67156c000 r-xp 0000a000 00:12 53308 /usr/lib/libnss_files-2.22.so 7fa67156c000-7fa67156d000 rwxp 0000b000 00:12 53308 /usr/lib/libnss_files-2.22.so 7fa67156d000-7fa671576000 rwxp 00000000 00:00 0 7fa671576000-7fa671711000 r-xp 00000000 00:12 53267 /usr/lib/libc-2.22.so 7fa671711000-7fa671910000 ---p 0019b000 00:12 53267 /usr/lib/libc-2.22.so 7fa671910000-7fa671914000 r-xp 0019a000 00:12 53267 /usr/lib/libc-2.22.so 7fa671914000-7fa671916000 rwxp 0019e000 00:12 53267 /usr/lib/libc-2.22.so 7fa671916000-7fa67191b000 rwxp 00000000 00:00 0 7fa67191b000-7fa671930000 r-xp 00000000 00:12 53314 /usr/lib/libnsl-2.22.so 7fa671930000-7fa671b2f000 ---p 00015000 00:12 53314 /usr/lib/libnsl-2.22.so 7fa671b2f000-7fa671b30000 r-xp 00014000 00:12 53314 /usr/lib/libnsl-2.22.so 7fa671b30000-7fa671b31000 rwxp 00015000 00:12 53314 /usr/lib/libnsl-2.22.so 7fa671b31000-7fa671b33000 rwxp 00000000 00:00 0 7fa671b33000-7fa671b36000 r-xp 00000000 00:12 53312 /usr/lib/libdl-2.22.so 7fa671b36000-7fa671d35000 ---p 00003000 00:12 53312 /usr/lib/libdl-2.22.so 7fa671d35000-7fa671d36000 r-xp 00002000 00:12 53312 /usr/lib/libdl-2.22.so 7fa671d36000-7fa671d37000 rwxp 00003000 00:12 53312 /usr/lib/libdl-2.22.so 7fa671d37000-7fa671e34000 r-xp 00000000 00:12 53313 /usr/lib/libm-2.22.so 7fa671e34000-7fa672033000 ---p 000fd000 00:12 53313 /usr/lib/libm-2.22.so 7fa672033000-7fa672034000 r-xp 000fc000 00:12 53313 /usr/lib/libm-2.22.so 7fa672034000-7fa672035000 rwxp 000fd000 00:12 53313 /usr/lib/libm-2.22.so 7fa672035000-7fa672036000 rwxp 00000000 00:00 0 7fa672036000-7fa67204a000 r-xp 00000000 00:12 53315 /usr/lib/libresolv-2.22.so 7fa67204a000-7fa672249000 ---p 00014000 00:12 53315 /usr/lib/libresolv-2.22.so 7fa672249000-7fa67224a000 r-xp 00013000 00:12 53315 /usr/lib/libresolv-2.22.so 7fa67224a000-7fa67224b000 rwxp 00014000 00:12 53315 /usr/lib/libresolv-2.22.so 7fa67224b000-7fa67224d000 rwxp 00000000 00:00 0 7fa67224d000-7fa672255000 r-xp 00000000 00:12 53304 /usr/lib/libcrypt-2.22.so 7fa672255000-7fa672455000 ---p 00008000 00:12 53304 /usr/lib/libcrypt-2.22.so 7fa672455000-7fa672456000 r-xp 00008000 00:12 53304 /usr/lib/libcrypt-2.22.so 7fa672456000-7fa672457000 rwxp 00009000 00:12 53304 /usr/lib/libcrypt-2.22.so 7fa672457000-7fa672485000 rwxp 00000000 00:00 0 7fa672485000-7fa67249a000 r-xp 00000000 00:12 25251 /usr/lib/libz.so.1.2.8 7fa67249a000-7fa672699000 ---p 00015000 00:12 25251 /usr/lib/libz.so.1.2.8 7fa672699000-7fa67269a000 r-xp 00014000 00:12 25251 /usr/lib/libz.so.1.2.8 7fa67269a000-7fa67269b000 rwxp 00015000 00:12 25251 /usr/lib/libz.so.1.2.8 7fa67269b000-7fa67269c000 rwxp 00000000 00:00 0 7fa6726a6000-7fa6726a7000 rwxp 00000000 00:00 0 7fa6726a7000-7fa6726c9000 r-xp 00000000 00:12 53266 /usr/lib/ld-2.22.so 7fa6726c9000-7fa6728c8000 ---p 00000000 00:00 0 7fa6728c8000-7fa6728c9000 r-xp 00021000 00:12 53266 /usr/lib/ld-2.22.so 7fa6728c9000-7fa6728ca000 rwxp 00022000 00:12 53266 /usr/lib/ld-2.22.so 7fa6728ca000-7fa6728cb000 rwxp 00000000 00:00 0 7ffe9e398000-7ffe9e3b9000 rwxp 00000000 00:00 0 [stack] 7ffe9e3f5000-7ffe9e3f7000 r--p 00000000 00:00 0 [vvar] 7ffe9e3f7000-7ffe9e3f9000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Process exited with code 134.