3v4l.org

run code in 300+ PHP versions simultaneously
<?php $constants = array( 'FOO' => 1, 'BAR' => 2, 'BAZ' => 3, 'FOO2' => 1, 'BAR2' => 2, 'BAZ2' => 3, ); echo 'max+array_count_values: '; $start = microtime(true); for($i=0; $i<1000; $i++) { $bool = (max(array_count_values($constants)) > 1); } $end = microtime(true); echo sprintf('%F', $end-$start) . PHP_EOL; echo 'count+array_unique+count: '; $start = microtime(true); for($i=0; $i<1000; $i++) { $bool = (count($constants) > count(array_unique($constants))); } $end = microtime(true); echo sprintf('%F', $end-$start) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 37
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 37
Branch analysis from position: 47
Branch analysis from position: 37
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
Branch analysis from position: 8
filename:       /in/ViprA
function name:  (null)
number of ops:  59
compiled vars:  !0 = $constants, !1 = $start, !2 = $i, !3 = $bool, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ECHO                                                     'max%2Barray_count_values%3A+'
   13     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   14     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->17
   15     8    >   INIT_FCALL                                               'max'
          9        INIT_FCALL                                               'array_count_values'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                         $10     
         14        IS_SMALLER                                       ~11     1, $10
         15        ASSIGN                                                   !3, ~11
   14    16        PRE_INC                                                  !2
         17    >   IS_SMALLER                                               !2, 1000
         18      > JMPNZ                                                    ~14, ->8
   17    19    >   INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $15     
         22        ASSIGN                                                   !4, $15
   18    23        INIT_FCALL                                               'sprintf'
         24        SEND_VAL                                                 '%25F'
         25        SUB                                              ~17     !4, !1
         26        SEND_VAL                                                 ~17
         27        DO_ICALL                                         $18     
         28        CONCAT                                           ~19     $18, '%0A'
         29        ECHO                                                     ~19
   21    30        ECHO                                                     'count%2Barray_unique%2Bcount%3A+'
   22    31        INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $20     
         34        ASSIGN                                                   !1, $20
   23    35        ASSIGN                                                   !2, 0
         36      > JMP                                                      ->45
   24    37    >   COUNT                                            ~23     !0
         38        INIT_FCALL                                               'array_unique'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $24     
         41        COUNT                                            ~25     $24
         42        IS_SMALLER                                       ~26     ~25, ~23
         43        ASSIGN                                                   !3, ~26
   23    44        PRE_INC                                                  !2
         45    >   IS_SMALLER                                               !2, 1000
         46      > JMPNZ                                                    ~29, ->37
   26    47    >   INIT_FCALL                                               'microtime'
         48        SEND_VAL                                                 <true>
         49        DO_ICALL                                         $30     
         50        ASSIGN                                                   !4, $30
   27    51        INIT_FCALL                                               'sprintf'
         52        SEND_VAL                                                 '%25F'
         53        SUB                                              ~32     !4, !1
         54        SEND_VAL                                                 ~32
         55        DO_ICALL                                         $33     
         56        CONCAT                                           ~34     $33, '%0A'
         57        ECHO                                                     ~34
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.04 ms | 1400 KiB | 23 Q