3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class Ymodulus { /** * This properties is meant to hold a list of new comers */ public $newComers; /** * This method is meant to determine if a student is in the list of newcomers *@Param string $newComer | i casted the variable to always return a string. *@return boolean. true|false. true if name is in list of newComers and false if its not. */ public function welcomes(string $newComer) { # here i am checking for the user inputed name in the array. Note am using the short form of if / else statement. return (in_array($newComers, $this->newComer)) ? true : false; } } //Usage $ymodulus = new Ymodulus(); $ymodulus->newComers =['MizMyColi', 'other New Bie']; $result = Ymodulus->welcomes('MizMyColi'); echo ($result === true ) ? 'MizMyColi Ymodulus welcomes you too the world of php': 'sorry not yet welcomed by ymodulus'; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kg2sd
function name:  (null)
number of ops:  17
compiled vars:  !0 = $ymodulus, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $2      'Ymodulus'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        ASSIGN_OBJ                                               !0, 'newComers'
          4        OP_DATA                                                  <array>
   28     5        FETCH_CONSTANT                                   ~6      'Ymodulus'
          6        INIT_METHOD_CALL                                         ~6, 'welcomes'
          7        SEND_VAL_EX                                              'MizMyColi'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   31    10        TYPE_CHECK                                    8          !1
         11      > JMPZ                                                     ~9, ->14
         12    >   QM_ASSIGN                                        ~10     'MizMyColi+Ymodulus+welcomes+you+too+the+world+of+php'
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~10     'sorry+not+yet+welcomed+by+ymodulus'
         15    >   ECHO                                                     ~10
   32    16      > RETURN                                                   1

Class Ymodulus:
Function welcomes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kg2sd
function name:  welcomes
number of ops:  12
compiled vars:  !0 = $newComer, !1 = $newComers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'in_array'
          2        SEND_VAR                                                 !1
          3        FETCH_OBJ_R                                      ~2      'newComer'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->9
          7    >   QM_ASSIGN                                        ~4      <true>
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~4      <false>
         10    > > RETURN                                                   ~4
   19    11*     > RETURN                                                   null

End of function welcomes

End of class Ymodulus.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.41 ms | 1396 KiB | 15 Q