3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* String to print for an error where a parameter is missing from the post */ const ERROR_MISSING_PARAM = "10000"; $errors = array(); $number_of_errors = 0; function addError($error, $variable){ $errors[$variable] = $error; $number_of_errors = count($errors); } function printToJson(){ return json_encode($this->errors); } addError(ERROR_MISSING_PARAM, 'name'); echo $number_of_errors . "\r\n"; echo printToJson();
Output for git.master, git.master_jit, rfc.property-hooks
0 Fatal error: Uncaught Error: Using $this when not in object context in /in/Bu5a7:17 Stack trace: #0 /in/Bu5a7(22): printToJson() #1 {main} thrown in /in/Bu5a7 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:
41.2 ms | 401 KiB | 8 Q