3v4l.org

run code in 300+ PHP versions simultaneously
<?php #### Option 1: Restricted type values // booleans $a = false; ++$a; // bool(true) ++$a; // bool(true) $a = true; --$a; // bool(false) --$a; // bool(false) // null values $a = null; --$a; // null $a = null; ++$a; // null // empty strings $a = ''; ++$a; // int(1) #### Option 2: Integer values // booleans $a = false; ++$a; // bool(true) ++$a; // int(2) $a = true; --$a; // bool(false) --$a; // int(-1) // null values $a = null; --$a; // int(-1) $a = null; ++$a; // int(1) #### non-numeric strings $a = '12d9'; ++$a; // string(4) "12e0" + Notice: String increment is deprecated, use str_inc() instead in php shell code on line 1 echo $a; ++$a; // float(13) echo $a;
Output for git.master, git.master_jit, rfc.property-hooks
12e013

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:
40.29 ms | 401 KiB | 8 Q