3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(version_compare('10.0.', '10', '>=')); var_dump(version_compare('9.9.0', '10', '>=')); var_dump(version_compare('9', '10', '>=')); var_dump(version_compare('10.0.1', '10', '>=')); switch ('sqlsrv') { case 'mysql': echo "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . "ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->timeCol = VALUES($this->timeCol)"; case 'oci': // DUAL is Oracle specific dummy table echo "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) " . "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . "WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time"; case 'sqlsrv' && version_compare('10.0', '10', '>='): // MS SQL Server requires MERGE be terminated by semicolon echo "MERGE"; case 'sqlite': echo "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)"; }
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(false) bool(false) bool(true) MERGE Fatal error: Uncaught Error: Using $this when not in object context in /in/Ve2tD:21 Stack trace: #0 {main} thrown in /in/Ve2tD on line 21
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:
42.87 ms | 401 KiB | 8 Q