3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array( 'a', 'b' ); echo current($x); $x = 'a'; echo current( (array)$x );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O3B3F
function name:  (null)
number of ops:  12
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'current'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ECHO                                                     $2
    6     5        ASSIGN                                                   !0, 'a'
    7     6        INIT_FCALL                                               'current'
          7        CAST                                          7  ~4      !0
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        ECHO                                                     $5
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.56 ms | 1394 KiB | 15 Q