3v4l.org

run code in 300+ PHP versions simultaneously
<?php $commonNames = ["*.jemoeder.nl", "blaat.jemoeder.nl"]; if(count($commonNames) == 0) { return null; } usort($commonNames, function($a, $b) { $aIsWildcard = substr($a, 0, 1) == '*'; $bIsWildcard = substr($b, 0, 1) == '*'; return $aIsWildcard && $bIsWildcard ? -1 : 1; } ); var_dump( $commonNames[0]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h8Qpd
function name:  (null)
number of ops:  15
compiled vars:  !0 = $commonNames
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        COUNT                                            ~2      !0
          2        IS_EQUAL                                                 ~2, 0
          3      > JMPZ                                                     ~3, ->5
    6     4    > > RETURN                                                   null
    9     5    >   INIT_FCALL                                               'usort'
          6        SEND_REF                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fh8Qpd%3A9%240'
   14     8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   16    10        INIT_FCALL                                               'var_dump'
         11        FETCH_DIM_R                                      ~6      !0, 0
         12        SEND_VAL                                                 ~6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fh8Qpd%3A9%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/h8Qpd
function name:  {closure}
number of ops:  24
compiled vars:  !0 = $a, !1 = $b, !2 = $aIsWildcard, !3 = $bIsWildcard
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $4      
          7        IS_EQUAL                                         ~5      $4, '%2A'
          8        ASSIGN                                                   !2, ~5
   11     9        INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $7      
         14        IS_EQUAL                                         ~8      $7, '%2A'
         15        ASSIGN                                                   !3, ~8
   13    16      > JMPZ_EX                                          ~10     !2, ->18
         17    >   BOOL                                             ~10     !3
         18    > > JMPZ                                                     ~10, ->21
         19    >   QM_ASSIGN                                        ~11     -1
         20      > JMP                                                      ->22
         21    >   QM_ASSIGN                                        ~11     1
         22    > > RETURN                                                   ~11
   14    23*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fh8Qpd%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.35 ms | 1400 KiB | 19 Q