PHP Classes
elePHPant
Icontem

File: Versioning/example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Asher Wolfstein  >  Platform versioning  >  Versioning/example.php  >  Download  
File: Versioning/example.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: Platform versioning
Check and compare the current PHP version
Author: By
Last change: added var_dumps
Date: 7 years ago
Size: 845 bytes
 

Contents

Class file image Download
<?php

$v
= phpversion();
if (
intval( substr( $v, 0, 1 ) ) >= 5 ) {
    require_once(
'class5.php' );
   
var_dump( Platform_versioning_v5::compare_versions( '5.1.0', '>=' ) );
   
var_dump( Platform_versioning_v5::compare_versions( '5.2', '<' ) );
   
var_dump( Platform_versioning_v5::compare_versions( '4.3', '<=' ) );
} elseif (
substr( $v, 0, 1 ) == '4' ) {
    require_once(
'class.php' );
   
var_dump( Platform_versioning::compare_versions( '5.1.0', '>=' ) );
   
var_dump( Platform_versioning::compare_versions( '5.2', '<' ) );
   
var_dump( Platform_versioning::compare_versions( '4.3', '<=' ) );
} else {
    require_once(
'proc.php' );
   
var_dump( platform_versioning_compare_versions( '5.1.0', '<' ) );
   
var_dump( platform_versioning_compare_versions( '4.3', '>' ) );
   
var_dump( platform_versioning_compare_versions( '3.0', '>=' ) );
}

?>