3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Booleans echo json_encode(true) . PHP_EOL; // Intergers echo json_encode(42) . PHP_EOL; // Floats echo json_encode(3.145) . PHP_EOL; // Strings echo json_encode('test') . PHP_EOL; // True arrays echo json_encode([1, 2, 3]) . PHP_EOL; // Associative arrays echo json_encode(['key' => 'value']) . PHP_EOL; // Objects $obj = new stdClass; $obj->foo = 'bar'; echo json_encode($obj) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/slIBZ
function name:  (null)
number of ops:  41
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                                   'json_encode'
          1        SEND_VAL                                                     <true>
          2        DO_ICALL                                             $1      
          3        CONCAT                                               ~2      $1, '%0A'
          4        ECHO                                                         ~2
    7     5        INIT_FCALL                                                   'json_encode'
          6        SEND_VAL                                                     42
          7        DO_ICALL                                             $3      
          8        CONCAT                                               ~4      $3, '%0A'
          9        ECHO                                                         ~4
   10    10        INIT_FCALL                                                   'json_encode'
         11        SEND_VAL                                                     3.145
         12        DO_ICALL                                             $5      
         13        CONCAT                                               ~6      $5, '%0A'
         14        ECHO                                                         ~6
   13    15        INIT_FCALL                                                   'json_encode'
         16        SEND_VAL                                                     'test'
         17        DO_ICALL                                             $7      
         18        CONCAT                                               ~8      $7, '%0A'
         19        ECHO                                                         ~8
   16    20        INIT_FCALL                                                   'json_encode'
         21        SEND_VAL                                                     <array>
         22        DO_ICALL                                             $9      
         23        CONCAT                                               ~10     $9, '%0A'
         24        ECHO                                                         ~10
   19    25        INIT_FCALL                                                   'json_encode'
         26        SEND_VAL                                                     <array>
         27        DO_ICALL                                             $11     
         28        CONCAT                                               ~12     $11, '%0A'
         29        ECHO                                                         ~12
   22    30        NEW                                                  $13     'stdClass'
         31        DO_FCALL                                          0          
         32        ASSIGN                                                       !0, $13
   23    33        ASSIGN_OBJ                                                   !0, 'foo'
         34        OP_DATA                                                      'bar'
   24    35        INIT_FCALL                                                   'json_encode'
         36        SEND_VAR                                                     !0
         37        DO_ICALL                                             $17     
         38        CONCAT                                               ~18     $17, '%0A'
         39        ECHO                                                         ~18
   25    40      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.95 ms | 505 KiB | 10 Q