3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "turn on 0,0 through 999,999"; $lights = [[]]; for($i = 0; $i<1000; $i++){ for($j = 0; $j<1000; $j++){ $lights[$i][$j] = 0; } } explode("\n",$input); function action($s){ $on = preg_match("/turn on/"); $off = preg_match("/turn off/"); $toggle = preg_match("/toggle/"); if($on > 0){ return 1; } else if($off>0){ return 2; } else if($toggle>0){ return 3; } } echo action($input); ?>
Output for git.master, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: preg_match() expects at least 2 arguments, 1 given in /in/SDOZB:15 Stack trace: #0 /in/SDOZB(15): preg_match('/turn on/') #1 /in/SDOZB(29): action('turn on 0,0 thr...') #2 {main} thrown in /in/SDOZB on line 15
Process exited with code 255.
Output for git.master_jit
Fatal error: Out of memory (allocated 18874368 bytes) (tried to allocate 20480 bytes) in /in/SDOZB on line 8 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
61.19 ms | 401 KiB | 8 Q