3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_position($atts) { $string = $_SESSION['position']; $vowels = array("a,e,i,o,u"); $first_letter = strtolower(substr($string,0,1)); if( in_array($first_letter,$vowels) ) { $string = "an <strong>".ucfirst($string)."</strong>"; } else { $string = "a <strong>".ucfirst($string)."</strong>"; } return $string; } get_position("Advertising");
Output for git.master, git.master_jit
Warning: Undefined global variable $_SESSION in /in/fOvQC on line 4 Warning: Trying to access array offset on value of type null in /in/fOvQC on line 4 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/fOvQC on line 6 Deprecated: ucfirst(): Passing null to parameter #1 ($string) of type string is deprecated in /in/fOvQC on line 10
Output for rfc.property-hooks
Warning: Undefined global variable $_SESSION in /in/fOvQC on line 4 Warning: Trying to access array offset on null in /in/fOvQC on line 4 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/fOvQC on line 6 Deprecated: ucfirst(): Passing null to parameter #1 ($string) of type string is deprecated in /in/fOvQC on line 10

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:
34.55 ms | 401 KiB | 8 Q