3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "Hello"; $b = "world"; $matching = array_unique(array_intersect(str_split(strtolower($a)), str_split(strtolower($b)))); $s = microtime(true); if(count($matching)>0) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$s)*100; $t = microtime(true); if($matching) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$t)*100;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 53
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
Branch analysis from position: 35
filename:       /in/Vfg6J
function name:  (null)
number of ops:  61
compiled vars:  !0 = $a, !1 = $b, !2 = $matching, !3 = $s, !4 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello'
    4     1        ASSIGN                                                   !1, 'world'
    6     2        INIT_FCALL                                               'array_unique'
          3        INIT_FCALL                                               'array_intersect'
          4        INIT_FCALL                                               'str_split'
          5        INIT_FCALL                                               'strtolower'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        SEND_VAR                                                 $7
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        INIT_FCALL                                               'str_split'
         12        INIT_FCALL                                               'strtolower'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        DO_ICALL                                         $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                         $11     
         19        SEND_VAR                                                 $11
         20        DO_ICALL                                         $12     
         21        ASSIGN                                                   !2, $12
    7    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $14     
         25        ASSIGN                                                   !3, $14
    8    26        COUNT                                            ~16     !2
         27        IS_SMALLER                                               0, ~16
         28      > JMPZ                                                     ~17, ->35
         29    >   INIT_FCALL                                               'implode'
         30        SEND_VAL                                                 '%2C+'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $18     
         33        CONCAT                                           ~19     '%0Amatching+characters%3A+', $18
         34        ECHO                                                     ~19
    9    35    >   INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $20     
         38        SUB                                              ~21     $20, !3
         39        MUL                                              ~22     ~21, 100
         40        CONCAT                                           ~23     '%0A', ~22
         41        ECHO                                                     ~23
   11    42        INIT_FCALL                                               'microtime'
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                         $24     
         45        ASSIGN                                                   !4, $24
   12    46      > JMPZ                                                     !2, ->53
         47    >   INIT_FCALL                                               'implode'
         48        SEND_VAL                                                 '%2C+'
         49        SEND_VAR                                                 !2
         50        DO_ICALL                                         $26     
         51        CONCAT                                           ~27     '%0Amatching+characters%3A+', $26
         52        ECHO                                                     ~27
   13    53    >   INIT_FCALL                                               'microtime'
         54        SEND_VAL                                                 <true>
         55        DO_ICALL                                         $28     
         56        SUB                                              ~29     $28, !4
         57        MUL                                              ~30     ~29, 100
         58        CONCAT                                           ~31     '%0A', ~30
         59        ECHO                                                     ~31
   14    60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.49 ms | 1021 KiB | 19 Q