RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

You fskers

TMSTKSBK

Lord
Because it isn't O.O....it's more like Perl?

Although with PHP 5, you do have the nice object-orientedness...
I got to use some of that with the srpe website...was fun...sorta.

And you have to use a $ in front of vars?
 

Killamus

Knight
Code:
switch ($x)
{
case 1:
  echo "Number 1";
  break;
case 2:
  echo "Number 2";
  break;
case 3:
  echo "Number 3";
  break;
default:
  echo "No number between 1 and 3";
}
?>
Code:
<?php
$d=date("D");
if ($d=="Fri")
  echo "Have a nice weekend!"; 
elseif ($d=="Sun")
  echo "Have a nice Sunday!"; 
else
  echo "Have a nice day!"; 
?>
This seriously looks like C# to me.
 

TMSTKSBK

Lord
Console.WriteLine, tbh...

(I'm nitpicking, yes)

But seriously, most programming languages have similarities to a lot of others (thus how I can "speak" 5 or 6 languages that do things, beyond HTML/XML/CSS).

...except TCL, which I pray you NEVER have to use.

Have I mentioned I <3 PHP to death??

btw, you can also use echo with ()s...
 

Killamus

Knight
One thing I don't get. Lets say you do something like
Code:
<?php
$string "Hi";
$int 98;
$int1 2;

echo $string . $int + $string . "<br />";
wouldn't that be unsafe code and like cause an error with IE or FF?
 

TMSTKSBK

Lord
I don't think the browsers really care, cause PHP goes off and does its own thing, and then spits it out on the page. Whether or not it's good code is another matter entirely...

Make yourself a file to just do random crap in. I have one...I use it to prototype looped stuff, particularly forms...
 

mordero

Knight
yeah PHP is a weakly typed language, so it will try to cast any type of variable to whatever you want it to be. So if you were to try to add a string that cant be cast into an integer, then it becomes 0. So
PHP:
$str = "hahahaha";//if casted to an int, would be 0
$int = 5;
$result = $str + $int; //would be 5 still

also, the browser doesnt get anything but html, javascript, etc. PHP is all server side, the browser never sees any of the logic
 

mordero

Knight
well php5 moved toward better OO and ugly syntax? what are you talking about? the only thing really missing from php, which it should include by php6 is namespaces.
 

WarAngel

Wanderer
Coming from PHP4's OO, "better" OO doesn't really qualify as anything. :d I admit that it's a big step up, but it's still lacking, at least from what I've seen.

The syntax in PHP is goddamned ugly. Compare it to other languages and the structure just makes me want to cry. I'm a code aesthetics whore, so I guess that kind of explains my problem with it.
 

mordero

Knight
lol, not sure what you mean by ugly syntax, but then again php was the first language I ever learned and ive been working with it for 4 or 5 years now (although ive not done much in the last year or so, been learning c#). I always thought it was weird that other languages didnt identify variables with some sort of symbole (like php does with $) lol
 

TMSTKSBK

Lord
Mostly Perl, though. You could probably copy and paste PHP code into a Perl script, except for PHP-specific stuff.
 

Nott32

Wanderer
Frieking php5 is pissing me off :( Dosnt show errors in the script so all I get is a fucking blank page. >_<

PHP:
<?php
//Wont show images FYI
echo "MUHAHAHAHA its the RunUO Forums";
include 'http://www.runuo.com/forums';
?>
Theres my ub3r l337 PHP Script :p
 

WarAngel

Wanderer
Nott32;641960 said:
Frieking php5 is pissing me off :( Dosnt show errors in the script so all I get is a fucking blank page. >_<

PHP:
<?php
//Wont show images FYI
echo "MUHAHAHAHA its the RunUO Forums";
include 'http://www.runuo.com/forums';
?>
Theres my ub3r l337 PHP Script :p

You are pretty much a professional web developer! :D
 
Top