3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "mama"; $array = array ( 1 => "a", 2 => "b", 3=> "c", ); $andra = array( 1=>12, 3=>14); $andra[]=56; $nr=count($array); for($i=1;$i<$nr;$i++){ echo "eu si tu : {$array[$i]}\n"; } var_dump($array); class eu { function do_eu(){ echo " eu eu eu \n"; } } $nou = new eu; $nou ->do_eu(); print (new eu)->a ; function a( $array ){ foreach( $array as $key => $value ){ if( is_array( $value ) ) $array[ $key ] = a( $value ); } return (object) $array; } function bebe( $andra ) { foreach( $andra as $key => $value) { if(is_array($value) ) $andra[$key]= bebe($value); } return(object) $andra; } $eee = (object) array( 'foo' => (object) array( 'bar' => 'baz', 'pax' => 'vax' ), 'moo' => 'ui' ); print $eee->foo->bar; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/JkIA5
function name:  (null)
number of ops:  38
compiled vars:  !0 = $array, !1 = $andra, !2 = $nr, !3 = $i, !4 = $nou, !5 = $eee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'mama'
    4     1        ASSIGN                                                   !0, <array>
   11     2        ASSIGN                                                   !1, <array>
   13     3        ASSIGN_DIM                                               !1
          4        OP_DATA                                                  56
   15     5        COUNT                                            ~9      !0
          6        ASSIGN                                                   !2, ~9
   16     7        ASSIGN                                                   !3, 1
          8      > JMP                                                      ->15
   18     9    >   ROPE_INIT                                     3  ~14     'eu+si+tu+%3A+'
         10        FETCH_DIM_R                                      ~12     !0, !3
         11        ROPE_ADD                                      1  ~14     ~14, ~12
         12        ROPE_END                                      2  ~13     ~14, '%0A'
         13        ECHO                                                     ~13
   16    14        PRE_INC                                                  !3
         15    >   IS_SMALLER                                               !3, !2
         16      > JMPNZ                                                    ~17, ->9
   21    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
   29    20        NEW                                              $19     'eu'
         21        DO_FCALL                                      0          
         22        ASSIGN                                                   !4, $19
   30    23        INIT_METHOD_CALL                                         !4, 'do_eu'
         24        DO_FCALL                                      0          
   32    25        NEW                                              $23     'eu'
         26        DO_FCALL                                      0          
         27        FETCH_OBJ_R                                      ~25     $23, 'a'
         28        ECHO                                                     ~25
   53    29        CAST                                          8  ~26     <array>
         30        INIT_ARRAY                                       ~27     ~26, 'foo'
   56    31        ADD_ARRAY_ELEMENT                                ~27     'ui', 'moo'
         32        CAST                                          8  ~28     ~27
   51    33        ASSIGN                                                   !5, ~28
   58    34        FETCH_OBJ_R                                      ~30     !5, 'foo'
         35        FETCH_OBJ_R                                      ~31     ~30, 'bar'
         36        ECHO                                                     ~31
   60    37      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/JkIA5
function name:  a
number of ops:  16
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   35     1      > FE_RESET_R                                       $3      !0, ->12
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->12
          3    >   ASSIGN                                                   !2, ~4
   36     4        TYPE_CHECK                                  128          !1
          5      > JMPZ                                                     ~6, ->11
          6    >   INIT_FCALL_BY_NAME                                       'a'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $8      
          9        ASSIGN_DIM                                               !0, !2
         10        OP_DATA                                                  $8
   35    11    > > JMP                                                      ->2
         12    >   FE_FREE                                                  $3
   38    13        CAST                                          8  ~9      !0
         14      > RETURN                                                   ~9
   39    15*     > RETURN                                                   null

End of function a

Function bebe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/JkIA5
function name:  bebe
number of ops:  16
compiled vars:  !0 = $andra, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   RECV                                             !0      
   43     1      > FE_RESET_R                                       $3      !0, ->12
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->12
          3    >   ASSIGN                                                   !2, ~4
   44     4        TYPE_CHECK                                  128          !1
          5      > JMPZ                                                     ~6, ->11
          6    >   INIT_FCALL_BY_NAME                                       'bebe'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $8      
          9        ASSIGN_DIM                                               !0, !2
         10        OP_DATA                                                  $8
   43    11    > > JMP                                                      ->2
         12    >   FE_FREE                                                  $3
   46    13        CAST                                          8  ~9      !0
         14      > RETURN                                                   ~9
   47    15*     > RETURN                                                   null

End of function bebe

Class eu:
Function do_eu:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JkIA5
function name:  do_eu
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ECHO                                                     '+eu+eu+eu+%0A'
   27     1      > RETURN                                                   null

End of function do_eu

End of class eu.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.59 ms | 1404 KiB | 15 Q