3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add ($v1,$v2) { $v[] = (string) $v1; $v[] = (string) $v2; foreach ($v as $val) { preg_match('/\.(\d*)/',$match,$val); $dec[] = strlen($val); } var_dump($dec); } add(10.756,10.98324534); var_dump(bcadd(10.917,10)); var_dump(bcadd(10.917,10,0)); var_dump(bcadd(10.917,10,1)); var_dump(bcadd(10.917,10,2)); var_dump(bcadd(10.917,10,3)); var_dump(bcadd(10.917,10,4));
Output for git.master, git.master_jit
Warning: Undefined variable $match in /in/1Th4Q on line 6 Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/1Th4Q on line 6 Fatal error: Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in /in/1Th4Q:7 Stack trace: #0 /in/1Th4Q(11): add(10.756, 10.98324534) #1 {main} thrown in /in/1Th4Q on line 7
Process exited with code 255.
Output for rfc.property-hooks
Warning: Undefined variable $match in /in/1Th4Q on line 6 Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/1Th4Q on line 6 Fatal error: Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, array given in /in/1Th4Q:7 Stack trace: #0 /in/1Th4Q(11): add(10.756, 10.98324534) #1 {main} thrown in /in/1Th4Q on line 7
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:
37.44 ms | 401 KiB | 8 Q