3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); echo 'Testing on PHP version ' . PHP_VERSION . PHP_EOL . PHP_EOL; echo 'Checking if "__DIR__" is defined.' . PHP_EOL; if (!defined('__DIR__')) { echo 'No, "__DIR__" is not defined. Defining it now.' . PHP_EOL; define('__DIR__', 'bar'); echo 'Checking again if "__DIR__" is defined.' . PHP_EOL; if (!defined('__DIR__')) { echo 'Damn! *Seems like* "__DIR__" is still not defined.' . PHP_EOL; } else{ echo 'Strike, "__DIR__" is defined now.' . PHP_EOL; } echo 'Anyway, here is what `var_dump(__DIR__)` returns:' . PHP_EOL; var_dump(__DIR__); } else{ echo 'Yep, "__DIR__" is defined.' . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Testing on PHP version 8.3.0-dev Checking if "__DIR__" is defined. No, "__DIR__" is not defined. Defining it now. Checking again if "__DIR__" is defined. Strike, "__DIR__" is defined now. Anyway, here is what `var_dump(__DIR__)` returns: string(3) "/in"

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