3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterations = 100000; class A {protected $a; protected $b; protected $c;} class AHydrator extends A { public function hydrate(A $a, array $data) { $a->a = $data['a']; $a->b = $data['b']; $a->c = $data['c']; } } $aHydrator = function(array $data) { $this->a = $data['a']; $this->b = $data['b']; $this->c = $data['c']; }; $data = array('a' => 1, 'b' => 2, 'c' => 3); $a = new A(); for ($i = 0; $i < $iterations; $i++) { $aHydrator->bidTo($a)($data); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/HXrmp
function name:  (null)
number of ops:  19
compiled vars:  !0 = $iterations, !1 = $aHydrator, !2 = $data, !3 = $a, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 100000
   12     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FHXrmp%3A12%240'
          2        ASSIGN                                                   !1, ~6
   17     3        ASSIGN                                                   !2, <array>
   18     4        NEW                                              $9      'A'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !3, $9
   19     7        ASSIGN                                                   !4, 0
          8      > JMP                                                      ->16
   20     9    >   INIT_METHOD_CALL                                         !1, 'bidTo'
         10        SEND_VAR_EX                                              !3
         11        DO_FCALL                                      0  $13     
         12        INIT_DYNAMIC_CALL                                        $13
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0          
   19    15        PRE_INC                                                  !4
         16    >   IS_SMALLER                                               !4, !0
         17      > JMPNZ                                                    ~16, ->9
   21    18    > > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FHXrmp%3A12%240

Class A: [no user functions]
Class AHydrator:
Function hydrate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HXrmp
function name:  hydrate
number of ops:  12
compiled vars:  !0 = $a, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        FETCH_DIM_R                                      ~3      !1, 'a'
          3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  ~3
    8     5        FETCH_DIM_R                                      ~5      !1, 'b'
          6        ASSIGN_OBJ                                               !0, 'b'
          7        OP_DATA                                                  ~5
    9     8        FETCH_DIM_R                                      ~7      !1, 'c'
          9        ASSIGN_OBJ                                               !0, 'c'
         10        OP_DATA                                                  ~7
   10    11      > RETURN                                                   null

End of function hydrate

End of class AHydrator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.09 ms | 1399 KiB | 13 Q