3v4l.org

run code in 300+ PHP versions simultaneously
<?php $orig = 'welcome-to-your-world-42'; //$orig = 'welcome'; $parts = explode('-', $orig); if (1 < count($parts)) { usort($parts, function($a, $b) { return strlen($a) < strlen($b); }); $s1 = array_shift($parts); $s2 = array_shift($parts); } else { $s1 = $s2 = $orig; } echo $s1 . PHP_EOL . $s2;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7IQEP
function name:  (null)
number of ops:  29
compiled vars:  !0 = $orig, !1 = $parts, !2 = $s1, !3 = $s2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'welcome-to-your-world-42'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        COUNT                                            ~7      !1
          7        IS_SMALLER                                               1, ~7
          8      > JMPZ                                                     ~8, ->23
    7     9    >   INIT_FCALL                                               'usort'
         10        SEND_REF                                                 !1
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7IQEP%3A7%240'
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
    8    14        INIT_FCALL                                               'array_shift'
         15        SEND_REF                                                 !1
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !2, $11
    9    18        INIT_FCALL                                               'array_shift'
         19        SEND_REF                                                 !1
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !3, $13
         22      > JMP                                                      ->25
   11    23    >   ASSIGN                                           ~15     !3, !0
         24        ASSIGN                                                   !2, ~15
   14    25    >   CONCAT                                           ~17     !2, '%0A'
         26        CONCAT                                           ~18     ~17, !3
         27        ECHO                                                     ~18
   15    28      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7IQEP%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7IQEP
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        STRLEN                                           ~2      !0
          3        STRLEN                                           ~3      !1
          4        IS_SMALLER                                       ~4      ~2, ~3
          5      > RETURN                                                   ~4
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7IQEP%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.78 ms | 1400 KiB | 19 Q