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); ?>

preferences:
26.29 ms | 406 KiB | 5 Q