Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less1,2,3 #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
280 changes: 279 additions & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions less1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Created by PhpStorm.
* User: denis
* Date: 23/02/2019
* Time: 15:31
*/
//task1
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

//echo $abraCadabra;
//var_dump();
//require '';

//task2
//task3
$a = 5;
$b = '05';
var_dump($a == $b); // приведение типов $b преобразует в int ранвый 5
var_dump((int)'012345'); // приведение типов преобразует в int!
var_dump((float)123.0 === (int)123.0); //int целочисленное число float дробное поэтому false
var_dump((int)0 === (int)'hello, world'); // строку hello word преобразует в число равное 0
//task4

$h1 = 'Hello World!';
$title = 'The time is now!';
?>

<html>
<head></head>
<body>
<h1><?= $h1 ?></h1>
<div><?= $title ?></div>
</body>
</html>
<br/>
<br/>
//task5
<br/>
<?php
$a = 3;
$b = 5;

$a = $a + $b;
$b = $b - $a;
$b = -$b;
$a = $a - $b;

echo 'a=' .$a;
echo '<br/>';
echo 'b=' .$b;


Loading