3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Parameter { private $data; public function __construct( $data ){ $this->data = $data; } public function __toString(){ return $this->data; } } class ParentClass { function do_something( Parameter $a, Parameter $b = NULL ){ echo "a:$a" . PHP_EOL; echo "b:$b" . PHP_EOL; } } class ChildClass extends ParentClass { function do_something( Parameter $a, Parameter $b = NULL ){ parent::do_something($a,$b); } } $child = new ChildClass(); $a = new Parameter('test'); echo $child->do_something( $a );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jmhsj
function name:  (null)
number of ops:  13
compiled vars:  !0 = $child, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'parameter'
   28     1        NEW                                              $2      'ChildClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   30     4        NEW                                              $5      'Parameter'
          5        SEND_VAL_EX                                              'test'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   32     8        INIT_METHOD_CALL                                         !0, 'do_something'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12      > RETURN                                                   1

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

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jmhsj
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   12     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class Parameter.

Class ParentClass:
Function do_something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jmhsj
function name:  do_something
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   17     2        NOP                                                      
          3        FAST_CONCAT                                      ~2      'a%3A', !0
          4        CONCAT                                           ~3      ~2, '%0A'
          5        ECHO                                                     ~3
   18     6        NOP                                                      
          7        FAST_CONCAT                                      ~4      'b%3A', !1
          8        CONCAT                                           ~5      ~4, '%0A'
          9        ECHO                                                     ~5
   19    10      > RETURN                                                   null

End of function do_something

End of class ParentClass.

Class ChildClass:
Function do_something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jmhsj
function name:  do_something
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   24     2        INIT_STATIC_METHOD_CALL                                  'do_something'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   25     6      > RETURN                                                   null

End of function do_something

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.19 ms | 1399 KiB | 13 Q