<?php
var_dump(version_compare('3.7.5', '3.7.0', 'ge')); // true, OK
var_dump(version_compare('3.7.5', '3.7.0', ' ')); // null, should throw invalid argument exception at best
var_dump(version_compare('3.7.5', '3.7.0', ' ge')); // null, should throw invalid argument exception at best
var_dump(version_compare('3.7.5', '3.7.0', 'ge ')); // null, should throw invalid argument exception at best
var_dump(version_compare('3.7.5', '3.7.0', 'invalid')); // null, should throw invalid argument exception at best
bool(true)
Fatal error: Uncaught ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator in /in/CrO0J:4
Stack trace:
#0 /in/CrO0J(4): version_compare('3.7.5', '3.7.0', ' ')
#1 {main}
thrown in /in/CrO0J on line 4
Process exited with code 255.