3v4l.org

run code in 300+ PHP versions simultaneously
<?php function minimize($file) { return preg_replace('#(<\?php)\s+#S','$1 ',preg_replace('#\s*([(){}[\];,.:+<>*/%^=&?|$-])\s*#S', '$1', array_reduce(token_get_all(php_strip_whitespace($file)),function($c,$x){ static $s = [], $i=0; if ( is_string($x) ) return $c . $x; $_ = $x[1]; if ( $x[0] == 310 ) return $c . (defined($_) ? (is_bool($k=constant($_))||is_null($k)?$_:$k) : $_); if ( $x[0] == 312 ) return $c . (empty($s[$_]) ? ($s[$_] = '$_' . base_convert($i++,10,36)) : $s[$_]); if ( $x[0] == 263 ) return $c . '||'; if ( $x[0] == 265 ) return $c . '&&'; return $c . $_; }))); } echo minimize(__FILE__);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4f0Gi
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'minimize'
          1        SEND_VAL                                                 '%2Fin%2F4f0Gi'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function minimize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4f0Gi
function name:  minimize
number of ops:  24
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%23%28%3C%5C%3Fphp%29%5Cs%2B%23S'
          3        SEND_VAL                                                 '%241+'
          4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%23%5Cs%2A%28%5B%28%29%7B%7D%5B%5C%5D%3B%2C.%3A%2B%3C%3E%2A%2F%25%5E%3D%26%3F%7C%24-%5D%29%5Cs%2A%23S'
          6        SEND_VAL                                                 '%241'
    5     7        INIT_FCALL                                               'array_reduce'
          8        INIT_FCALL                                               'token_get_all'
          9        INIT_FCALL                                               'php_strip_whitespace'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $1      
         12        SEND_VAR                                                 $1
         13        DO_ICALL                                         $2      
         14        SEND_VAR                                                 $2
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4f0Gi%3A5%240'
   13    16        SEND_VAL                                                 ~3
         17        DO_ICALL                                         $4      
         18        SEND_VAR                                                 $4
         19        DO_ICALL                                         $5      
         20        SEND_VAR                                                 $5
         21        DO_ICALL                                         $6      
         22      > RETURN                                                   $6
   14    23*     > RETURN                                                   null

End of function minimize

Function %00%7Bclosure%7D%2Fin%2F4f0Gi%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 34
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 31
Branch analysis from position: 17
2 jumps found. (Code = 47) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 25
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 54
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 50
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4f0Gi
function name:  {closure}
number of ops:  67
compiled vars:  !0 = $c, !1 = $x, !2 = $s, !3 = $i, !4 = $_, !5 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
    7     4        TYPE_CHECK                                   64          !1
          5      > JMPZ                                                     ~6, ->8
          6    >   CONCAT                                           ~7      !0, !1
          7      > RETURN                                                   ~7
          8    >   FETCH_DIM_R                                      ~8      !1, 1
          9        ASSIGN                                                   !4, ~8
    8    10        FETCH_DIM_R                                      ~10     !1, 0
         11        IS_EQUAL                                                 ~10, 310
         12      > JMPZ                                                     ~11, ->34
         13    >   INIT_FCALL                                               'defined'
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                         $12     
         16      > JMPZ                                                     $12, ->31
         17    >   INIT_FCALL                                               'constant'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $13     
         20        ASSIGN                                           ~14     !5, $13
         21        TYPE_CHECK                                   12  ~15     ~14
         22      > JMPNZ_EX                                         ~15     ~15, ->25
         23    >   TYPE_CHECK                                    2  ~16     !5
         24        BOOL                                             ~15     ~16
         25    > > JMPZ                                                     ~15, ->28
         26    >   QM_ASSIGN                                        ~17     !4
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~17     !5
         29    >   QM_ASSIGN                                        ~18     ~17
         30      > JMP                                                      ->32
         31    >   QM_ASSIGN                                        ~18     !4
         32    >   CONCAT                                           ~19     !0, ~18
         33      > RETURN                                                   ~19
    9    34    >   FETCH_DIM_R                                      ~20     !1, 0
         35        IS_EQUAL                                                 ~20, 312
         36      > JMPZ                                                     ~21, ->54
         37    >   ISSET_ISEMPTY_DIM_OBJ                         1          !2, !4
         38      > JMPZ                                                     ~22, ->50
         39    >   INIT_FCALL                                               'base_convert'
         40        POST_INC                                         ~24     !3
         41        SEND_VAL                                                 ~24
         42        SEND_VAL                                                 10
         43        SEND_VAL                                                 36
         44        DO_ICALL                                         $25     
         45        CONCAT                                           ~26     '%24_', $25
         46        ASSIGN_DIM                                       ~23     !2, !4
         47        OP_DATA                                                  ~26
         48        QM_ASSIGN                                        ~27     ~23
         49      > JMP                                                      ->52
         50    >   FETCH_DIM_R                                      ~28     !2, !4
         51        QM_ASSIGN                                        ~27     ~28
         52    >   CONCAT                                           ~29     !0, ~27
         53      > RETURN                                                   ~29
   10    54    >   FETCH_DIM_R                                      ~30     !1, 0
         55        IS_EQUAL                                                 ~30, 263
         56      > JMPZ                                                     ~31, ->59
         57    >   CONCAT                                           ~32     !0, '%7C%7C'
         58      > RETURN                                                   ~32
   11    59    >   FETCH_DIM_R                                      ~33     !1, 0
         60        IS_EQUAL                                                 ~33, 265
         61      > JMPZ                                                     ~34, ->64
         62    >   CONCAT                                           ~35     !0, '%26%26'
         63      > RETURN                                                   ~35
   12    64    >   CONCAT                                           ~36     !0, !4
         65      > RETURN                                                   ~36
   13    66*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4f0Gi%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
206.72 ms | 952 KiB | 29 Q