3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NonEmptySetter { public function __set($name, $value) { $this->{$name} = $value; } } class EmptySetter { public function __set($name, $value) {} } function benchmark($obj) { $start_time = microtime(TRUE); for ($i = 0; $i < 100; $i++) { $obj->foo = 42; } return microtime(TRUE) - $start_time; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6ASHe
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   1

Function benchmark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
Branch analysis from position: 7
filename:       /in/6ASHe
function name:  benchmark
number of ops:  18
compiled vars:  !0 = $obj, !1 = $start_time, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   13     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->10
   14     7    >   ASSIGN_OBJ                                               !0, 'foo'
          8        OP_DATA                                                  42
   13     9        PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, 100
         11      > JMPNZ                                                    ~8, ->7
   16    12    >   INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $9      
         15        SUB                                              ~10     $9, !1
         16      > RETURN                                                   ~10
   17    17*     > RETURN                                                   null

End of function benchmark

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

End of function __set

End of class NonEmptySetter.

Class EmptySetter:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6ASHe
function name:  __set
number of ops:  3
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function __set

End of class EmptySetter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.59 ms | 1392 KiB | 15 Q