3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class first { protected $someArray = array(); } class second extends first { protected $someArray = array(); protected $someValue = null; public function __construct($someValue) { $this->someValue = $someValue; $this->newVal = 1; } } $objFirst = new second('1235'); $objSecond = new second('321'); var_dump ($objFirst == $objSecond); (array)($objFirst); var_dump ($objFirst == $objSecond);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vTYj5
function name:  (null)
number of ops:  19
compiled vars:  !0 = $objFirst, !1 = $objSecond
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'second'
          1        SEND_VAL_EX                                              '1235'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   20     4        NEW                                              $5      'second'
          5        SEND_VAL_EX                                              '321'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   23     8        INIT_FCALL                                               'var_dump'
          9        IS_EQUAL                                         ~8      !0, !1
         10        SEND_VAL                                                 ~8
         11        DO_ICALL                                                 
   24    12        CAST                                          7  ~10     !0
         13        FREE                                                     ~10
   25    14        INIT_FCALL                                               'var_dump'
         15        IS_EQUAL                                         ~11     !0, !1
         16        SEND_VAL                                                 ~11
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class first: [no user functions]
Class second:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vTYj5
function name:  __construct
number of ops:  6
compiled vars:  !0 = $someValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        ASSIGN_OBJ                                               'someValue'
          2        OP_DATA                                                  !0
   15     3        ASSIGN_OBJ                                               'newVal'
          4        OP_DATA                                                  1
   16     5      > RETURN                                                   null

End of function __construct

End of class second.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.02 ms | 1395 KiB | 15 Q