3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo json_encode([json_encode([1], JSON_PRETTY_PRINT)]), "\n"; $fp = fopen('php://stdin', 'r'); $data = ['a' => $fp]; echo json_encode($data), "\n"; echo json_encode([json_encode([1], JSON_PRETTY_PRINT)]), "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/reS06
function name:  (null)
number of ops:  33
compiled vars:  !0 = $fp, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_encode'
          1        INIT_FCALL                                               'json_encode'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 128
          4        DO_ICALL                                         $2      
          5        INIT_ARRAY                                       ~3      $2
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        ECHO                                                     $4
          9        ECHO                                                     '%0A'
    5    10        INIT_FCALL                                               'fopen'
         11        SEND_VAL                                                 'php%3A%2F%2Fstdin'
         12        SEND_VAL                                                 'r'
         13        DO_ICALL                                         $5      
         14        ASSIGN                                                   !0, $5
    6    15        INIT_ARRAY                                       ~7      !0, 'a'
         16        ASSIGN                                                   !1, ~7
    7    17        INIT_FCALL                                               'json_encode'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $9      
         20        ECHO                                                     $9
         21        ECHO                                                     '%0A'
    9    22        INIT_FCALL                                               'json_encode'
         23        INIT_FCALL                                               'json_encode'
         24        SEND_VAL                                                 <array>
         25        SEND_VAL                                                 128
         26        DO_ICALL                                         $10     
         27        INIT_ARRAY                                       ~11     $10
         28        SEND_VAL                                                 ~11
         29        DO_ICALL                                         $12     
         30        ECHO                                                     $12
         31        ECHO                                                     '%0A'
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.94 ms | 1401 KiB | 17 Q