3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a2; public $b2; public function mohamed($a){ $this->a2 = $a; return $this ; } public function test($b){ $this->b2 = $b; return $this ; } } $class = new A(); $class->mohamed('name')->test('mohamed');; echo $class->a2." and ".$class->b2;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nHeP9
function name:  (null)
number of ops:  15
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'mohamed'
          4        SEND_VAL_EX                                              'name'
          5        DO_FCALL                                      0  $4      
          6        INIT_METHOD_CALL                                         $4, 'test'
          7        SEND_VAL_EX                                              'mohamed'
          8        DO_FCALL                                      0          
   19     9        FETCH_OBJ_R                                      ~6      !0, 'a2'
         10        CONCAT                                           ~7      ~6, '+and+'
         11        FETCH_OBJ_R                                      ~8      !0, 'b2'
         12        CONCAT                                           ~9      ~7, ~8
         13        ECHO                                                     ~9
   20    14      > RETURN                                                   1

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

End of function mohamed

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nHeP9
function name:  test
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'b2'
          2        OP_DATA                                                  !0
   13     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   14     5*     > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
257.23 ms | 1008 KiB | 13 Q