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; } $output = get_position("Advertising"); echo $output;
Output for git.master, git.master_jit
Warning: Undefined global variable $_SESSION in /in/tghQn on line 4 Warning: Trying to access array offset on value of type null in /in/tghQn on line 4 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/tghQn on line 6 Deprecated: ucfirst(): Passing null to parameter #1 ($string) of type string is deprecated in /in/tghQn on line 10 a <strong></strong>
Output for rfc.property-hooks
Warning: Undefined global variable $_SESSION in /in/tghQn on line 4 Warning: Trying to access array offset on null in /in/tghQn on line 4 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/tghQn on line 6 Deprecated: ucfirst(): Passing null to parameter #1 ($string) of type string is deprecated in /in/tghQn on line 10 a <strong></strong>

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:
35.38 ms | 402 KiB | 8 Q