3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorPrinter { /* String to print for an error where a parameter is missing from the post */ const ERROR_MISSING_PARAM = "10000"; private $errors = array(); private $number_of_errors = 0; function addError($error, $variable){ $this->errors[$variable] = $error; $this->number_of_errors = count($this->errors); } function printToJson(){ return json_encode($this->errors); } function getNumberOfErrors(){ return $this->number_of_errors; } } $printer = new ErrorPrinter; $printer->addError(ErrorPrinter::ERROR_MISSING_PARAM, 'name'); echo $printer->getNumberOfErrors . "\r\n"; echo $printer->printToJson();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined property: ErrorPrinter::$getNumberOfErrors in /in/1u85n on line 26 {"name":"10000"}

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.26 ms | 401 KiB | 8 Q