3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface SlugifierInterface { /** * Return a URL safe version of a string. * * @param string $string * @return string */ public function slugify($string); } class Sluggifier implements SlugifierInterface { public function __construct() { } /* public function slugify($string) { return "I am from" . $string; } */ public function slugify($string) { return "I am from static " . $string; } } echo Sluggifier::slugify("Hello World") . "\n"; $sluggifier = new Sluggifier(); echo $sluggifier->slugify("Hello World from object") . "\n";
Output for git.master_jit, git.master, rfc.property-hooks
Fatal error: Uncaught Error: Non-static method Sluggifier::slugify() cannot be called statically in /in/j0mHe:30 Stack trace: #0 {main} thrown in /in/j0mHe on line 30
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:
45.89 ms | 401 KiB | 8 Q