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'; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "Ymodulus" in /in/kg2sd:28 Stack trace: #0 {main} thrown in /in/kg2sd on line 28
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
32.96 ms | 401 KiB | 8 Q