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)))); $t = microtime(true); if($matching) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$t)*100; $s = microtime(true); if(count($matching)>0) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$s)*100;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 33
Branch analysis from position: 27
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: 33
filename:       /in/H0sjA
function name:  (null)
number of ops:  61
compiled vars:  !0 = $a, !1 = $b, !2 = $matching, !3 = $t, !4 = $s
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
    8    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $14     
         25        ASSIGN                                                   !3, $14
    9    26      > JMPZ                                                     !2, ->33
         27    >   INIT_FCALL                                               'implode'
         28        SEND_VAL                                                 '%2C+'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $16     
         31        CONCAT                                           ~17     '%0Amatching+characters%3A+', $16
         32        ECHO                                                     ~17
   10    33    >   INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $18     
         36        SUB                                              ~19     $18, !3
         37        MUL                                              ~20     ~19, 100
         38        CONCAT                                           ~21     '%0A', ~20
         39        ECHO                                                     ~21
   12    40        INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $22     
         43        ASSIGN                                                   !4, $22
   13    44        COUNT                                            ~24     !2
         45        IS_SMALLER                                               0, ~24
         46      > JMPZ                                                     ~25, ->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
   14    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
   15    60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.88 ms | 1015 KiB | 19 Q