3v4l.org

run code in 300+ PHP versions simultaneously
<?php //method 1 $num = 1; echo "\n method 1: "; echo $num = (int) !$num; echo $num = (int) !$num; //method 2 $num = 1; echo "\n method 2: "; echo $num = array(1,0)[$num]; echo $num = array(1,0)[$num]; //method 3 $num = 1; echo "\n method 3: "; echo $num = (int) ($num < 1); echo $num = (int) ($num < 1); //method 4 $num = 1; echo "\n method 4: "; echo $num = (int)empty($num); echo $num = (int)empty($num); //method 4
Output for git.master, git.master_jit, rfc.property-hooks
method 1: 01 method 2: 01 method 3: 01 method 4: 01

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:
194.94 ms | 405 KiB | 5 Q