3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo; protected $bar; protected $baz; } $aHydrator = function(array $data) { $this->a = $data['a']; $this->b = $data['b']; $this->c = $data['c']; }; $data = array('foo' => 1, 'bar' => 2, 'baz' => 3); $hydrated = new Foo(); $data = array('a' => 1, 'b' => 2, 'c' => 3); $a = new A(); ($aHydrator->bindTo($a, $a))($data); var_dump($hydrated);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RjmMa
function name:  (null)
number of ops:  21
compiled vars:  !0 = $aHydrator, !1 = $data, !2 = $hydrated, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRjmMa%3A10%240'
          1        ASSIGN                                                   !0, ~4
   17     2        ASSIGN                                                   !1, <array>
   19     3        NEW                                              $7      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $7
   21     6        ASSIGN                                                   !1, <array>
   22     7        NEW                                              $11     'A'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $11
   23    10        INIT_METHOD_CALL                                         !0, 'bindTo'
         11        SEND_VAR_EX                                              !3
         12        SEND_VAR_EX                                              !3
         13        DO_FCALL                                      0  $14     
         14        INIT_DYNAMIC_CALL                                        $14
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
   25    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FRjmMa%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RjmMa
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        FETCH_THIS                                       $1      
          2        FETCH_DIM_R                                      ~3      !0, 'a'
          3        ASSIGN_OBJ                                               $1, 'a'
          4        OP_DATA                                                  ~3
   12     5        FETCH_THIS                                       $4      
          6        FETCH_DIM_R                                      ~6      !0, 'b'
          7        ASSIGN_OBJ                                               $4, 'b'
          8        OP_DATA                                                  ~6
   13     9        FETCH_THIS                                       $7      
         10        FETCH_DIM_R                                      ~9      !0, 'c'
         11        ASSIGN_OBJ                                               $7, 'c'
         12        OP_DATA                                                  ~9
   14    13      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRjmMa%3A10%240

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
203.48 ms | 1396 KiB | 15 Q