3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ifAllElseFails($type, $msg, $file, $line, $context) { echo ( "Ah what the hell. Doesn't work. But the meaning of life is 42. And chickens or eggs? Nah. It was a mutant gecko." ); } error_reporting(E_ALL); set_error_handler("ifAllElseFails"); class TheMeaningOfLif { var $came_first; var $the_answer; var $aeons; var $doubt; var $uncertainty; function TheMeaningOfLif() { $this->aeons = "150"; $this->doubt = ceil ( 13.3 * $this->Life() ); $this->uncertainty = floor ( 132 / $this->theUniverse() ); $this->the_answer[whatisthemeaning] = $this->andEverything(); $this->came_first = array ( "The Chicken", "The Egg" ); $this->came_first = arsort ( $this->came_first, SORT_NUMERIC ); $this->the_answer[whichcamefirst] = whichCameFirst($this->came_first); } function Life () { for ($x = 1; $x <= $this->aeons; $x++) { $r = 1 / ($x * $x); $s += $r; } $var = sqrt(6 * $s); return ( $var ); } function theUniverse () { $dw = 1; $l = 1; $up = 2; $var = 4; for ($x = 2; $x <= $var; $x++) { $l++; if ($l % 2 != 0) $up = $x + 1; elseif ($l % 2 == 0) $dw += 2; $var = $var * ($up/$dw); if ($l == 4) $l = 0; } return ( $var ); } function andEverything () { $carry = $this->doubt & $this->uncertainty; do { $carry = $carry << 1; $num1 = $this->doubt ^ $this->uncertainty; $sum = $this->doubt ^ $carry; $num2 = $carry; $carry = $this->doubt & $this->uncertainty; } while($carry != 0); return ( $carry ); } function whichCameFirst(&$arr) { function reverse_splice(&$splice, $i1, $i2) { if($i1>$i2) { $swp = $i1; $i1 = $i2; $i2 = $swp; } for($k=$i2;$k>=$i1;$k--){ $tmpArr[] = $splice[$k]; } for($k=0;$k<count($tmpArr);$k++) { $splice[$i1+$k] = $tmpArr[$k]; } } $i = count($arr); mt_srand((double)microtime()*1000000); while($i>0) { --$i; $j = @mt_rand(0, $i); if($i!=$j) { reverse_splice($arr, $i, $j); } } } function theGuruSays () { return ( $this->the_answer ); } } $TheMeaningOfLif = new TheMeaningOfLif; $the_answer = $TheMeaningOfLif->theGuruSays(); $var = $$the_answer[0]; $var = $$the_answer[1]; echo ( "The meaning of life is " . $whatisthemeaning . "<br>"); echo ( "Which came first? " . $whichcamefirst . " of course!");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ek3H5
function name:  (null)
number of ops:  25
compiled vars:  !0 = $TheMeaningOfLif, !1 = $the_answer, !2 = $var, !3 = $whatisthemeaning, !4 = $whichcamefirst
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    7     3        INIT_FCALL                                               'set_error_handler'
          4        SEND_VAL                                                 'ifAllElseFails'
          5        DO_ICALL                                                 
   88     6        NEW                                              $7      'TheMeaningOfLif'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $7
   89     9        INIT_METHOD_CALL                                         !0, 'theGuruSays'
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !1, $10
   90    12        FETCH_R                      local               ~12     !1
         13        FETCH_DIM_R                                      ~13     ~12, 0
         14        ASSIGN                                                   !2, ~13
   91    15        FETCH_R                      local               ~15     !1
         16        FETCH_DIM_R                                      ~16     ~15, 1
         17        ASSIGN                                                   !2, ~16
   92    18        CONCAT                                           ~18     'The+meaning+of+life+is+', !3
         19        CONCAT                                           ~19     ~18, '%3Cbr%3E'
         20        ECHO                                                     ~19
   93    21        CONCAT                                           ~20     'Which+came+first%3F+', !4
         22        CONCAT                                           ~21     ~20, '+of+course%21'
         23        ECHO                                                     ~21
         24      > RETURN                                                   1

Function ifallelsefails:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ek3H5
function name:  ifAllElseFails
number of ops:  7
compiled vars:  !0 = $type, !1 = $msg, !2 = $file, !3 = $line, !4 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
    4     5        ECHO                                                     'Ah+what+the+hell.+Doesn%27t+work.+But+the+meaning+of+life+is+42.+And+chickens+or+eggs%3F+Nah.+It+was+a+mutant+gecko.'
    5     6      > RETURN                                                   null

End of function ifallelsefails

Function %00reverse_splice%2Fin%2FEk3H5%3A63%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 18
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 18
Branch analysis from position: 26
Branch analysis from position: 18
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
Branch analysis from position: 10
Branch analysis from position: 8
filename:       /in/Ek3H5
function name:  reverse_splice
number of ops:  27
compiled vars:  !0 = $splice, !1 = $i1, !2 = $i2, !3 = $swp, !4 = $k, !5 = $tmpArr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   64     3        IS_SMALLER                                               !2, !1
          4      > JMPZ                                                     ~6, ->8
   65     5    >   ASSIGN                                                   !3, !1
          6        ASSIGN                                                   !1, !2
          7        ASSIGN                                                   !2, !3
   67     8    >   ASSIGN                                                   !4, !2
          9      > JMP                                                      ->14
   68    10    >   FETCH_DIM_R                                      ~12     !0, !4
         11        ASSIGN_DIM                                               !5
         12        OP_DATA                                                  ~12
   67    13        PRE_DEC                                                  !4
         14    >   IS_SMALLER_OR_EQUAL                                      !1, !4
         15      > JMPNZ                                                    ~14, ->10
   70    16    >   ASSIGN                                                   !4, 0
         17      > JMP                                                      ->23
   71    18    >   ADD                                              ~16     !1, !4
         19        FETCH_DIM_R                                      ~18     !5, !4
         20        ASSIGN_DIM                                               !0, ~16
         21        OP_DATA                                                  ~18
   70    22        PRE_INC                                                  !4
         23    >   COUNT                                            ~20     !5
         24        IS_SMALLER                                               !4, ~20
         25      > JMPNZ                                                    ~21, ->18
   73    26    > > RETURN                                                   null

End of function %00reverse_splice%2Fin%2FEk3H5%3A63%240

Class TheMeaningOfLif:
Function themeaningoflif:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ek3H5
function name:  TheMeaningOfLif
number of ops:  43
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN_OBJ                                               'aeons'
          1        OP_DATA                                                  '150'
   18     2        INIT_FCALL                                               'ceil'
          3        INIT_METHOD_CALL                                         'Life'
          4        DO_FCALL                                      0  $2      
          5        MUL                                              ~3      $2, 13.3
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        ASSIGN_OBJ                                               'doubt'
          9        OP_DATA                                                  $4
   19    10        INIT_FCALL                                               'floor'
         11        INIT_METHOD_CALL                                         'theUniverse'
         12        DO_FCALL                                      0  $6      
         13        DIV                                              ~7      132, $6
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                         $8      
         16        ASSIGN_OBJ                                               'uncertainty'
         17        OP_DATA                                                  $8
   20    18        FETCH_CONSTANT                                   ~10     'whatisthemeaning'
         19        INIT_METHOD_CALL                                         'andEverything'
         20        DO_FCALL                                      0  $12     
         21        FETCH_OBJ_W                                      $9      'the_answer'
         22        ASSIGN_DIM                                               $9, ~10
         23        OP_DATA                                                  $12
   21    24        ASSIGN_OBJ                                               'came_first'
         25        OP_DATA                                                  <array>
   22    26        INIT_FCALL                                               'arsort'
         27        FETCH_OBJ_W                                      $15     'came_first'
         28        SEND_REF                                                 $15
         29        SEND_VAL                                                 1
         30        DO_ICALL                                         $16     
         31        ASSIGN_OBJ                                               'came_first'
         32        OP_DATA                                                  $16
   23    33        FETCH_CONSTANT                                   ~18     'whichcamefirst'
         34        INIT_FCALL_BY_NAME                                       'whichCameFirst'
         35        CHECK_FUNC_ARG                                           
         36        FETCH_OBJ_FUNC_ARG                               $20     'came_first'
         37        SEND_FUNC_ARG                                            $20
         38        DO_FCALL                                      0  $21     
         39        FETCH_OBJ_W                                      $17     'the_answer'
         40        ASSIGN_DIM                                               $17, ~18
         41        OP_DATA                                                  $21
   24    42      > RETURN                                                   null

End of function themeaningoflif

Function life:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
Branch analysis from position: 2
filename:       /in/Ek3H5
function name:  Life
number of ops:  17
compiled vars:  !0 = $x, !1 = $r, !2 = $s, !3 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->7
   27     2    >   MUL                                              ~5      !0, !0
          3        DIV                                              ~6      1, ~5
          4        ASSIGN                                                   !1, ~6
   28     5        ASSIGN_OP                                     1          !2, !1
   26     6        PRE_INC                                                  !0
          7    >   FETCH_OBJ_R                                      ~10     'aeons'
          8        IS_SMALLER_OR_EQUAL                                      !0, ~10
          9      > JMPNZ                                                    ~11, ->2
   30    10    >   INIT_FCALL                                               'sqrt'
         11        MUL                                              ~12     !2, 6
         12        SEND_VAL                                                 ~12
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !3, $13
   31    15      > RETURN                                                   !3
   32    16*     > RETURN                                                   null

End of function life

Function theuniverse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
Branch analysis from position: 6
Branch analysis from position: 23
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
Branch analysis from position: 23
Branch analysis from position: 17
filename:       /in/Ek3H5
function name:  theUniverse
number of ops:  28
compiled vars:  !0 = $dw, !1 = $l, !2 = $up, !3 = $var, !4 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   ASSIGN                                                   !0, 1
   35     1        ASSIGN                                                   !1, 1
   36     2        ASSIGN                                                   !2, 2
   37     3        ASSIGN                                                   !3, 4
   38     4        ASSIGN                                                   !4, 2
          5      > JMP                                                      ->24
   39     6    >   PRE_INC                                                  !1
   40     7        MOD                                              ~11     !1, 2
          8        IS_NOT_EQUAL                                             ~11, 0
          9      > JMPZ                                                     ~12, ->13
   41    10    >   ADD                                              ~13     !4, 1
         11        ASSIGN                                                   !2, ~13
         12      > JMP                                                      ->17
   42    13    >   MOD                                              ~15     !1, 2
         14        IS_EQUAL                                                 ~15, 0
         15      > JMPZ                                                     ~16, ->17
   43    16    >   ASSIGN_OP                                     1          !0, 2
   44    17    >   DIV                                              ~18     !2, !0
         18        MUL                                              ~19     !3, ~18
         19        ASSIGN                                                   !3, ~19
   46    20        IS_EQUAL                                                 !1, 4
         21      > JMPZ                                                     ~21, ->23
   47    22    >   ASSIGN                                                   !1, 0
   38    23    >   PRE_INC                                                  !4
         24    >   IS_SMALLER_OR_EQUAL                                      !4, !3
         25      > JMPNZ                                                    ~24, ->6
   49    26    > > RETURN                                                   !3
   50    27*     > RETURN                                                   null

End of function theuniverse

Function andeverything:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 4
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/Ek3H5
function name:  andEverything
number of ops:  22
compiled vars:  !0 = $carry, !1 = $num1, !2 = $sum, !3 = $num2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   FETCH_OBJ_R                                      ~4      'doubt'
          1        FETCH_OBJ_R                                      ~5      'uncertainty'
          2        BW_AND                                           ~6      ~4, ~5
          3        ASSIGN                                                   !0, ~6
   54     4    >   SL                                               ~8      !0, 1
          5        ASSIGN                                                   !0, ~8
   55     6        FETCH_OBJ_R                                      ~10     'doubt'
          7        FETCH_OBJ_R                                      ~11     'uncertainty'
          8        BW_XOR                                           ~12     ~10, ~11
          9        ASSIGN                                                   !1, ~12
   56    10        FETCH_OBJ_R                                      ~14     'doubt'
         11        BW_XOR                                           ~15     !0, ~14
         12        ASSIGN                                                   !2, ~15
   57    13        ASSIGN                                                   !3, !0
   58    14        FETCH_OBJ_R                                      ~18     'doubt'
         15        FETCH_OBJ_R                                      ~19     'uncertainty'
         16        BW_AND                                           ~20     ~18, ~19
         17        ASSIGN                                                   !0, ~20
   59    18        IS_NOT_EQUAL                                             !0, 0
         19      > JMPNZ                                                    ~22, ->4
   60    20    > > RETURN                                                   !0
   61    21*     > RETURN                                                   null

End of function andeverything

Function whichcamefirst:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
Branch analysis from position: 12
Branch analysis from position: 27
filename:       /in/Ek3H5
function name:  whichCameFirst
number of ops:  30
compiled vars:  !0 = $arr, !1 = $i, !2 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
   63     1        DECLARE_FUNCTION                                         'reverse_splice'
   74     2        COUNT                                            ~3      !0
          3        ASSIGN                                                   !1, ~3
   75     4        INIT_FCALL                                               'mt_srand'
          5        INIT_FCALL                                               'microtime'
          6        DO_ICALL                                         $5      
          7        CAST                                          5  ~6      $5
          8        MUL                                              ~7      ~6, 1000000
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                                 
   76    11      > JMP                                                      ->27
   77    12    >   PRE_DEC                                                  !1
   78    13        BEGIN_SILENCE                                    ~10     
         14        INIT_FCALL                                               'mt_rand'
         15        SEND_VAL                                                 0
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $11     
         18        END_SILENCE                                              ~10
         19        ASSIGN                                                   !2, $11
   79    20        IS_NOT_EQUAL                                             !1, !2
         21      > JMPZ                                                     ~13, ->27
   80    22    >   INIT_FCALL_BY_NAME                                       'reverse_splice'
         23        SEND_VAR_EX                                              !0
         24        SEND_VAR_EX                                              !1
         25        SEND_VAR_EX                                              !2
         26        DO_FCALL                                      0          
   76    27    >   IS_SMALLER                                               0, !1
         28      > JMPNZ                                                    ~15, ->12
   83    29    > > RETURN                                                   null

End of function whichcamefirst

Function thegurusays:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ek3H5
function name:  theGuruSays
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   85     0  E >   FETCH_OBJ_R                                      ~0      'the_answer'
          1      > RETURN                                                   ~0
   86     2*     > RETURN                                                   null

End of function thegurusays

End of class TheMeaningOfLif.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.39 ms | 1416 KiB | 31 Q