3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fp = fopen('php://stdin', 'r'); $json = @json_encode(array('a' => 'foo', 'b' => $fp)); var_dump($json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KtOIa
function name:  (null)
number of ops:  17
compiled vars:  !0 = $fp, !1 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Fstdin'
          2        SEND_VAL                                                 'r'
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    3     5        BEGIN_SILENCE                                    ~4      
          6        INIT_FCALL                                               'json_encode'
          7        INIT_ARRAY                                       ~5      'foo', 'a'
          8        ADD_ARRAY_ELEMENT                                ~5      !0, 'b'
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                         $6      
         11        END_SILENCE                                              ~4
         12        ASSIGN                                                   !1, $6
    4    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.48 ms | 1386 KiB | 19 Q