3v4l.org

run code in 500+ 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); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oMsSb
function name:  (null)
number of ops:  15
compiled vars:  !0 = $argsObj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   CAST                                              8  ~1      <array>
   15     1        ASSIGN                                                       !0, ~1
   24     2        INIT_FCALL                                                   'pretty'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $3      
          5        CONCAT                                               ~4      'argsObj%3A+', $3
          6        CONCAT                                               ~5      ~4, '%0A'
          7        ECHO                                                         ~5
   26     8        INIT_FCALL                                                   'print_r'
          9        SEND_VAR                                                     !0
         10        DO_ICALL                                                     
   28    11        INIT_FCALL                                                   'var_dump'
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                                     
   29    14      > RETURN                                                       1

Function pretty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oMsSb
function name:  pretty
number of ops:  10
compiled vars:  !0 = $var
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        GET_TYPE                                             ~1      !0
          2        CONCAT                                               ~2      ~1, '+'
          3        INIT_FCALL                                                   'json_encode'
    6     4        SEND_VAR                                                     !0
   11     5        SEND_VAL                                                     2098112
    5     6        DO_ICALL                                             $3      
   11     7        CONCAT                                               ~4      ~2, $3
          8      > RETURN                                                       ~4
   13     9*     > RETURN                                                       null

End of function pretty

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.37 ms | 2208 KiB | 17 Q