3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Phrase { public function __construct($text, $arguments = array()) { $this->_text = (string)$text; $this->_arguments = $arguments; } public function __toString() { return $this->render($this->_text, $this->_arguments); } public function render($text, $arguments) { if ($arguments) { $placeholders = array(); for ($i = 1, $size = count($arguments); $i <= $size; $i++) { $placeholders[] = "%$i"; } $text = str_replace($placeholders, $arguments, $text); } return $text; } } function __(){ $argc = func_get_args(); return new Phrase(array_shift($argc), $argc); } try { throw new Exception(__('one %1 one' , 1111)); } catch (Exception $e) { var_dump(strpos($e->getMessage(), 'one 1111 one') !== FALSE); } $a = array(__('saadfdsa'), __('sdfgsda sa%1 ', 4), __('sdgsa gsag sg %1 gas g%2 w4', 1111,222)); echo implode($a);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property Phrase::$_text is deprecated in /in/dlce8 on line 7 Deprecated: Creation of dynamic property Phrase::$_arguments is deprecated in /in/dlce8 on line 8 bool(true) Deprecated: Creation of dynamic property Phrase::$_text is deprecated in /in/dlce8 on line 7 Deprecated: Creation of dynamic property Phrase::$_arguments is deprecated in /in/dlce8 on line 8 Deprecated: Creation of dynamic property Phrase::$_text is deprecated in /in/dlce8 on line 7 Deprecated: Creation of dynamic property Phrase::$_arguments is deprecated in /in/dlce8 on line 8 Deprecated: Creation of dynamic property Phrase::$_text is deprecated in /in/dlce8 on line 7 Deprecated: Creation of dynamic property Phrase::$_arguments is deprecated in /in/dlce8 on line 8 saadfdsasdfgsda sa4 sdgsa gsag sg 1111 gas g222 w4

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:
55.24 ms | 402 KiB | 8 Q