3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { public function __call($name, $params) { return 'foo'; } } function can_be_string($var) { return $var === null || is_scalar($var) || is_callable([$var, '__toString']); } $a = new Thing; var_dump(can_be_string($a)); (string) $a;
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) Fatal error: Uncaught Error: Object of class Thing could not be converted to string in /in/4ttLv:19 Stack trace: #0 {main} thrown in /in/4ttLv on line 19
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:
44.46 ms | 401 KiB | 8 Q