Example #1
0
 public function myClassFunction(BitwiseAnd $class, $other)
 {
     $d = \Stupid\MyClassWITHCONSTANT::VAR;
     $f = MY_CONSTANT;
     $test = new BitwiseAnd();
     $doSomething = myFunction();
     $c = new C();
     MyCladss::staticMethod();
     $someVar = new TestClass();
 }
Example #2
0
 public function test_recursive300()
 {
     $class = $this->myClass;
     $value = array(1, 2, 3, array(10, 20, 30));
     $item = array();
     foreach ($value as $k => $v) {
         $item[$k] = myFunction($v);
     }
     $test = $class::recursive('myFunction', $value);
     $this->assertSame($item, $test);
 }
Example #3
0
function myFunction($link)
{
    $header = getToken();
    $res = CallAPI('GET', $link, false, $header);
    $var = json_decode($res);
    $path = dirname(__FILE__) . "/files/";
    $file = $path . "Page_" . $var->paging->currentPage . ".json";
    echo $file;
    echo $var->paging->currentPage;
    file_put_contents($file, json_encode($var->list));
    //@todo put logs here $var->paging->next
    file_put_contents('script.log', "link: " . $var->paging->next . " Page: " . $var->paging->currentPage . "\n", FILE_APPEND);
    if ($var->paging->currentPage != $var->paging->totalPage) {
        echo $var->paging->next;
        myFunction($var->paging->next);
    }
}
Example #4
0
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package theme
 */
if (!is_active_sidebar('sidebar-1')) {
    return;
}
?>

<div id="secondary" class="widget-area" role="complementary">
	<?php 
dynamic_sidebar('sidebar-1');
?>
	<!--<?php 
myFunction(16);
?>
 -->
	<?php 
mySide();
?>
	<?php 
$txt = "hi";
?>
</div><!-- #secondary -->

<div>
<?php 
$txt = "hi";
?>
</div>
 function run()
 {
     $x = myFunction();
     return [' should not get here  '];
 }
<?php

error_reporting(E_ERROR);
function handleError($errno, $errstr, $error_file, $error_line)
{
    echo "<b>Error:</b> [{$errno}] {$errstr} - {$error_file}:{$error_line}";
    echo "<br />";
    echo "Terminating PHP Script";
    die;
}
//set error handler
set_error_handler("handleError");
//trigger error
trigger_error("error triggered");
myFunction();
Example #7
0
    case 'group':
        echo 'Вы выбрали группу';
        break;
    case 'interactive':
        echo 'Вы выбрали Интерактив';
        break;
    case 'individual':
        echo 'Вы выбрали Индивидуально';
        break;
    default:
        echo 'Вы ничего не выбрали';
        break;
}
newString();
$number = 5;
echo myFunction($number);
function myFunction($parameter)
{
    return $parameter * 2;
}
newString();
$headCount = 0;
$flipCount = 0;
while ($headCount < 3) {
    $flip = rand(0, 1);
    $flipCount++;
    if ($flip) {
        $headCount++;
        echo "<div class=\"coin\">H</div>";
    } else {
        $headCount = 0;
Example #8
0
		<div class="site-info">
			<a href="<?php 
echo esc_url(__('https://wordpress.org/', 'komaruga'));
?>
"><?php 
printf(esc_html__('Proudly powered by %s', 'komaruga'), 'WordPress');
?>
</a>
			<span class="sep"> | </span>
			<?php 
printf(esc_html__('Theme: %1$s by %2$s.', 'komaruga'), 'komaruga', '<a href="http://underscores.me/" rel="designer">Underscores.me</a>');
?>
		<!-- my code-->
		<footer>
		<div id="function">	Prodeced by COMARUGA DEVELOPERS (Koreena, Mauricio, Ruben, Gabriela)  <?php 
echo myFunction();
?>
</div>
			<div class="social-media-icons">
<div>
<a href="https://twitter.com/nyuniversity?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor">
<img title="Twitter" alt="Twitter" src="https://socialmediawidgets.files.wordpress.com/2014/03/01_twitter.png" width="35" height="35" />
</a>
<a href="https://www.pinterest.com/nyu1831fund/new-york-university/">
<img title="Pinterest" alt="Pinterest" src="https://socialmediawidgets.files.wordpress.com/2014/03/13_pinterest.png" width="35" height="35" />
</a>
<a href="https://www.facebook.com/NYU/">
<img title="Facebook" alt="Facebook" src="https://socialmediawidgets.files.wordpress.com/2014/03/02_facebook.png" width="35" height="35" />
</a>
<a href="https://www.linkedin.com/edu/new-york-university-18993">
<img title="LinkedIn" alt="LinkedIn" src="https://socialmediawidgets.files.wordpress.com/2014/03/07_linkedin.png" width="35" height="35" />
Example #9
0
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<?php 
function myFunction($name, $year)
{
    //functions syntax
    echo "his name is {$name} ali and he born in {$year}.<br/>";
}
myFunction("waqar", "1994");
myFunction("waqas", "1994");
myFunction("umair", "1994");
myFunction("sultan", "1994");
myFunction("muhabat", "1994");
myFunction("anwaar", "1994");
function sum($a, $b)
{
    $z = $a + $b;
    return $z;
}
echo "2 + 3 = " . sum(2, 3) . "<br/>";
echo "4+ 12 = " . sum(4, 12) . "<br/>";
echo "12 + 321 = " . sum(12, 321);
?>

</body>
</html>
<?php

// Consider the following code block:
function &myFunction()
{
    $string = "MyString";
    var_dump($string);
    return $undefined;
}
for ($i = 0; $i < 10; $i++) {
    $retval = myFunction();
}
// This code block's behavior has changed between PHP 4 and PHP 5. Why?
/*
1) None of the above																				OK
2) This could would cause an automatic segmentation fault in PHP 4
3) This code would throw a syntax error in PHP 4
4) Returning an undefined variable by reference in PHP 4 would cause eventual memory corruption
5) You could not return undefined variables by reference in PHP 4
*/
<?php

myFunction($name, $value);
ini_set($name, $value);
// Noncompliant
$x->ini_set($name, $value);
ini_set;
Example #12
0
<?php

//Tomcat/Apache req statements
ini_set('display_errors', 'On');
error_reporting(E_ALL);
//insert require statement to includes folder for header
require '_includes/header.inc.php';
//create array with keys my name, fav color, fav movie, fav book, fav website
$myArray = array('Dustin', 'Blue', 'The Other Guys', 'The Bible', 'www.espn.com');
$myName = $myArray[0];
echo "<h1>{$myName}</h1>";
//create function using a loop to return every value in the array EXCEPT name in a <ul> echo this function
function myFunction($myArray)
{
    foreach (array_slice($myArray, 1) as $item) {
        echo "<ul>{$item}</ul>";
    }
}
//execute myFunction
myFunction($myArray);
//insert require statement to includes folder for footer
require '_includes/footer.inc.php';
Example #13
0
<?php

function myFunction($a)
{
    $a++;
}
$b = 1;
myFunction(&$b);
echo $b;
Example #14
0
<?php

interface myInterface
{
    function test();
}
class myClass extends myInterface
{
    public function test()
    {
        echo 'test';
    }
}
function myFunction(myInterface $obj)
{
    $obj->test();
}
$obj = new myClass();
myFunction($obj);