3v4l.org

run code in 500+ PHP versions simultaneously
<?php function assign() { trigger_error('foo', E_USER_WARNING); return "test"; } $t = assign(); function errorHandler() {} function testEh() { $start = microtime(); set_error_handler('errorHandler'); $a = assign(); restore_error_handler(); return microtime() - $start; } $sumMicrotime = 0; for($i = 0; $i < 10000; $i++) { $sumMicrotime += testEh(); } echo "avg (errorhandler): " . ($sumMicrotime / 10000); echo "\n"; function testAt() { $start = microtime(); $b = @assign(); return microtime() - $start; } $sumMicrotime = 0; for($i = 0; $i < 10000; $i++) { $sumMicrotime += testAt(); } echo "avg (shut-up): " . ($sumMicrotime / 10000);
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 = 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
Branch analysis from position: 19
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/Pscrm
function name:  (null)
number of ops:  29
compiled vars:  !0 = $t, !1 = $sumMicrotime, !2 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                                   'assign'
          1        DO_FCALL                                          0  $3      
          2        ASSIGN                                                       !0, $3
   20     3        ASSIGN                                                       !1, 0
   21     4        ASSIGN                                                       !2, 0
          5      > JMP                                                          ->10
   22     6    >   INIT_FCALL                                                   'testeh'
          7        DO_FCALL                                          0  $7      
          8        ASSIGN_OP                                         1          !1, $7
   21     9        PRE_INC                                                      !2
         10    >   IS_SMALLER                                                   !2, 10000
         11      > JMPNZ                                                        ~10, ->6
   25    12    >   DIV                                                  ~11     !1, 10000
         13        CONCAT                                               ~12     'avg+%28errorhandler%29%3A+', ~11
         14        ECHO                                                         ~12
   27    15        ECHO                                                         '%0A'
   35    16        ASSIGN                                                       !1, 0
   36    17        ASSIGN                                                       !2, 0
         18      > JMP                                                          ->23
   37    19    >   INIT_FCALL                                                   'testat'
         20        DO_FCALL                                          0  $15     
         21        ASSIGN_OP                                         1          !1, $15
   36    22        PRE_INC                                                      !2
         23    >   IS_SMALLER                                                   !2, 10000
         24      > JMPNZ                                                        ~18, ->19
   40    25    >   DIV                                                  ~19     !1, 10000
         26        CONCAT                                               ~20     'avg+%28shut-up%29%3A+', ~19
         27        ECHO                                                         ~20
         28      > RETURN                                                       1

Function assign:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pscrm
function name:  assign
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                                   'trigger_error'
          1        SEND_VAL                                                     'foo'
          2        SEND_VAL                                                     512
          3        DO_ICALL                                                     
    5     4      > RETURN                                                       'test'
    6     5*     > RETURN                                                       null

End of function assign

Function errorhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pscrm
function name:  errorHandler
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                       null

End of function errorhandler

Function testeh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pscrm
function name:  testEh
number of ops:  16
compiled vars:  !0 = $start, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                                   'microtime'
          1        DO_ICALL                                             $2      
          2        ASSIGN                                                       !0, $2
   14     3        INIT_FCALL                                                   'set_error_handler'
          4        SEND_VAL                                                     'errorHandler'
          5        DO_ICALL                                                     
   15     6        INIT_FCALL                                                   'assign'
          7        DO_FCALL                                          0  $5      
          8        ASSIGN                                                       !1, $5
   16     9        INIT_FCALL                                                   'restore_error_handler'
         10        DO_ICALL                                                     
   17    11        INIT_FCALL                                                   'microtime'
         12        DO_ICALL                                             $8      
         13        SUB                                                  ~9      $8, !0
         14      > RETURN                                                       ~9
   18    15*     > RETURN                                                       null

End of function testeh

Function testat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pscrm
function name:  testAt
number of ops:  13
compiled vars:  !0 = $start, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                                   'microtime'
          1        DO_ICALL                                             $2      
          2        ASSIGN                                                       !0, $2
   31     3        BEGIN_SILENCE                                        ~4      
          4        INIT_FCALL                                                   'assign'
          5        DO_FCALL                                          0  $5      
          6        END_SILENCE                                                  ~4
          7        ASSIGN                                                       !1, $5
   32     8        INIT_FCALL                                                   'microtime'
          9        DO_ICALL                                             $7      
         10        SUB                                                  ~8      $7, !0
         11      > RETURN                                                       ~8
   33    12*     > RETURN                                                       null

End of function testat

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
178.05 ms | 2207 KiB | 22 Q