3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Baz { protected $foo; protected $bar; } class Proxy { private $realObj; public function __construct($realObj) { $this->realObj = $realObj; } public function extract(array $data = array()) { foreach ($data as $key => $val) { if (property_exists($this->realObj, $key)) { $this->$key = $val; } } return $this; } } $data = array('foo' => 'bar'); $baz = new Baz; $proxy = new Proxy($baz); var_dump($proxy->extract($data));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7DSNJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $data, !1 = $baz, !2 = $proxy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   ASSIGN                                                   !0, <array>
   31     1        NEW                                              $4      'Baz'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   32     4        NEW                                              $7      'Proxy'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $7
   34     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !2, 'extract'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0  $10     
         12        SEND_VAR                                                 $10
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function __construct

Function extract:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/7DSNJ
function name:  extract
number of ops:  17
compiled vars:  !0 = $data, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV_INIT                                        !0      <array>
   20     1      > FE_RESET_R                                       $3      !0, ->13
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->13
          3    >   ASSIGN                                                   !2, ~4
   21     4        INIT_FCALL                                               'property_exists'
          5        FETCH_OBJ_R                                      ~6      'realObj'
          6        SEND_VAL                                                 ~6
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9      > JMPZ                                                     $7, ->12
   22    10    >   ASSIGN_OBJ                                               !2
         11        OP_DATA                                                  !1
   20    12    > > JMP                                                      ->2
         13    >   FE_FREE                                                  $3
   25    14        FETCH_THIS                                       ~9      
         15      > RETURN                                                   ~9
   26    16*     > RETURN                                                   null

End of function extract

End of class Proxy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.19 ms | 1400 KiB | 17 Q