3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct($options = null) { if (is_array($options)) { var_dump(is_string(key($options))); } } } $options = array('foo' => 'bar'); next($options); next($options); $foo = new Foo($options);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e6r6E
function name:  (null)
number of ops:  12
compiled vars:  !0 = $options, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'next'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
   14     4        INIT_FCALL                                               'next'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                                 
   15     7        NEW                                              $5      'Foo'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $5
         11      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/e6r6E
function name:  __construct
number of ops:  11
compiled vars:  !0 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    6     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~1, ->10
    7     3    >   INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'key'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        TYPE_CHECK                                   64  ~3      $2
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                                 
    9    10    > > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.28 ms | 1434 KiB | 16 Q