3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Identifier { protected $id; public function __construct($id) { $this->id = $id; } public function getValue() { return $this->id; } } class Example { protected $id; public function __construct(Identifier $id) { $this->id = $id; } public function sameValueAs($test) { return $test->id === $this->id; } } $identifier = new Identifier('1'); $example = new Example($identifier); var_dump($example);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CZT0U
function name:  (null)
number of ops:  12
compiled vars:  !0 = $identifier, !1 = $example
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $2      'Identifier'
          1        SEND_VAL_EX                                              '1'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   34     4        NEW                                              $5      'Example'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   36     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class Identifier:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CZT0U
function name:  __construct
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CZT0U
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'id'
          1      > RETURN                                                   ~0
   15     2*     > RETURN                                                   null

End of function getvalue

End of class Identifier.

Class Example:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CZT0U
function name:  __construct
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
   25     3      > RETURN                                                   null

End of function __construct

Function samevalueas:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CZT0U
function name:  sameValueAs
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        FETCH_OBJ_R                                      ~1      !0, 'id'
          2        FETCH_OBJ_R                                      ~2      'id'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   30     5*     > RETURN                                                   null

End of function samevalueas

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.93 ms | 1400 KiB | 15 Q