3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'fromWeightkg', 'toWeightkg', 'value', 1, 0, '1', '0', ); foreach ($array as $value) { var_dump(gr($value)); } function gr($str) { $str[0] = strtoupper($str[0]); return $str; }
Output for git.master, git.master_jit
string(12) "FromWeightkg" string(10) "ToWeightkg" string(5) "Value" Warning: Trying to access array offset on value of type int in /in/QiZhG on line 17 Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /in/QiZhG on line 17 Fatal error: Uncaught Error: Cannot use a scalar value as an array in /in/QiZhG:17 Stack trace: #0 /in/QiZhG(13): gr(1) #1 {main} thrown in /in/QiZhG on line 17
Process exited with code 255.
Output for rfc.property-hooks
string(12) "FromWeightkg" string(10) "ToWeightkg" string(5) "Value" Warning: Trying to access array offset on int in /in/QiZhG on line 17 Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /in/QiZhG on line 17 Fatal error: Uncaught Error: Cannot use a scalar value as an array in /in/QiZhG:17 Stack trace: #0 /in/QiZhG(13): gr(1) #1 {main} thrown in /in/QiZhG on line 17
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:
38.03 ms | 401 KiB | 8 Q