3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = (array) json_decode('{"0":"toto","1":"tata"}'); print_r( $array ); $tata = array_search( 'tata', $array ); var_dump( $tata ); echo $array[ $tata ];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vE9hq
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $tata
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%220%22%3A%22toto%22%2C%221%22%3A%22tata%22%7D'
          2        DO_ICALL                                         $2      
          3        CAST                                          7  ~3      $2
          4        ASSIGN                                                   !0, ~3
    3     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
    4     8        INIT_FCALL                                               'array_search'
          9        SEND_VAL                                                 'tata'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
    5    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
    6    16        FETCH_DIM_R                                      ~9      !0, !1
         17        ECHO                                                     ~9
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.36 ms | 1394 KiB | 21 Q