3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Returns a string containing the type, and value in prettyfied JSON, of the argument. function pretty ($var) { return gettype($var) . ' ' . json_encode( $var, JSON_UNESCAPED_SLASHES | // Don't escape forward slashes. stripslashes() could be used afterwards instead JSON_UNESCAPED_UNICODE | // Print unicode characters insteas of their encoding "€" vs "\u20ac" JSON_PRETTY_PRINT | // Nice layout over several lines, human readable JSON_PARTIAL_OUTPUT_ON_ERROR | // Substitute whatever can not be printed JSON_INVALID_UTF8_SUBSTITUTE // Convert invalid UTF-8 characters to \0xfffd (Unicode Character 'REPLACEMENT CHARACTER') ); // Constants: https://www.php.net/manual/en/json.constants.php } $argsObj = (object) [ 'operation' => 'acquireNext', 'args' => [ 'workerIntegration' => 1, 'workerType' => '2', 'jobStatus' => 'scheduled' ], 'caller' => __FILE__ . ':' . __LINE__ ]; echo "argsObj: " . pretty($argsObj) . PHP_EOL; print_r($argsObj); var_dump($argsObj); ?>
Output for git.master, git.master_jit, rfc.property-hooks
argsObj: object { "operation": "acquireNext", "args": { "workerIntegration": 1, "workerType": "2", "jobStatus": "scheduled" }, "caller": "/in/oMsSb:22" } stdClass Object ( [operation] => acquireNext [args] => Array ( [workerIntegration] => 1 [workerType] => 2 [jobStatus] => scheduled ) [caller] => /in/oMsSb:22 ) object(stdClass)#1 (3) { ["operation"]=> string(11) "acquireNext" ["args"]=> array(3) { ["workerIntegration"]=> int(1) ["workerType"]=> string(1) "2" ["jobStatus"]=> string(9) "scheduled" } ["caller"]=> string(12) "/in/oMsSb:22" }

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:
153.83 ms | 407 KiB | 5 Q