[ create a new paste ] login | about

Link: http://codepad.org/vaELABEm    [ raw code | output | fork ]

PHP, pasted on Apr 4:
<?
$something = 12;
$somethingelse = 12;
$x = array('something','==','somethingelse');
list($valA, $operation, $valB) = $x;

// Replace values
$valA = $$valA;
$valB = $$valB;

// Run operation
$result = false;
switch($operation){
    case '==':
        $result = $valA == $valB;
        break;
    default:
        break;
}
if($result){
    echo "YAY";
}


Output:
1
YAY


Create a new paste based on this one


Comments: