3v4l.org

run code in 300+ PHP versions simultaneously
<?php class getData { public $myArray; function __construct() { $something = array(); array_push($something,"cat"); array_push($something,"dog"); $this->myArray = $something; return $something; } } $p = new getData(); var_dump($p); var_dump($p->myArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UjCc7
function name:  (null)
number of ops:  11
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'getData'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   18     6        INIT_FCALL                                               'var_dump'
          7        FETCH_OBJ_R                                      ~5      !0, 'myArray'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class getData:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UjCc7
function name:  __construct
number of ops:  13
compiled vars:  !0 = $something
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_push'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'cat'
          4        DO_ICALL                                                 
   10     5        INIT_FCALL                                               'array_push'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'dog'
          8        DO_ICALL                                                 
   11     9        ASSIGN_OBJ                                               'myArray'
         10        OP_DATA                                                  !0
   12    11      > RETURN                                                   !0
   13    12*     > RETURN                                                   null

End of function __construct

End of class getData.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.88 ms | 1395 KiB | 17 Q